A Django app for extending the Wagtail Image model to add captions and alt fields as
Project description
Captions for Wagtail Images
A Django app for extending the Wagtail Image model to add captions and alt fields as well as the extraction of IPTC image meta data.
Installing
Settings
In your settings file, add wagtailmedia
to INSTALLED_APPS
:
INSTALLED_APPS = [
# ...
"wagtailimagecaptions",
# ...
]
You will also need to set a custom Image model in your setting files:
# settings.py
WAGTAILIMAGES_IMAGE_MODEL = "wagtailimagecaptions.CaptionedImage"
How to Use
The custom Image model, CaptionedImage
, adds four new fields to the Wagtail Image model: alt
, caption
, credit
, iptc_data
. When a new image is uploaded via Wagtail's media library, the app will attempt to extract any IPTC meta data found in the file and fill
the alt
, caption
and credit
fields. All IPTC meta data extracted is also stored in iptc_data
.
Example use in a template:
<img src="{{ image.url }}" alt="{{ image.alt }}"><p>{{ image.caption }}</p>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for wagtailimagecaptions-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f99f344b1e43c1f546a5dad430dfe8b9213bbf7f298e1defb69d0c702d3370e9 |
|
MD5 | 1167d5621d5ba8f690b20ea632f28e5a |
|
BLAKE2b-256 | d6d276566197c0fe96bd4451f5b80522e97df8326b2dc49b7127631de42ba82c |
Hashes for wagtailimagecaptions-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f2cd0a3a16d8df33b5d093c31e5a9b2f31aaa0f45f3fd2484cd7f44a250b311 |
|
MD5 | 6fa27d69bbc619aa346f331cf2f379d8 |
|
BLAKE2b-256 | 2428946186e8725326b09d311a735ce00081f23965fc5a3d6d713a3ef1e71b39 |