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
Install using pip:
pip install wagtailimagecaptions
Settings
In your settings file, add wagtailimagecaptions
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"
Migrating
Heads up! If you have existing images, you will need to create a data migration operation to move the old images into the new model.
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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bba250001e6ae49c2a17629acbb2a7d7f4503af9d6fb14f234c4f82b94064d7f |
|
MD5 | 60024f34eacbdad6c9b33562510a16cb |
|
BLAKE2b-256 | e07507b691cddbb8de7012ed22b306a17cfa852c52dafc7f7ef10a23335349b0 |
Hashes for wagtailimagecaptions-0.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6e7fb44d1742643d6e4701977fc5f5eb3c4bb8560d035d2a4c215c06542ef68 |
|
MD5 | c163c0feb84cefc1c2b0ae7e05df959c |
|
BLAKE2b-256 | e2e443f0728ea343dc32c89af6fe45ec1270c696990fde97e68d51a944492c06 |