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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab0a47e815ed86d22639c42a7adfd59da6fbb8970e791ac6c718df4f19309293 |
|
MD5 | 279fd177edf287d527216f6edf6a0ebc |
|
BLAKE2b-256 | 4d76148aaf871758d79d34dbd73e84567915acecb58b7931910461eaeb26d78b |
Hashes for wagtailimagecaptions-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0cb0732bddae702b7ce7c461007f4e8e51694cb4d4cef1c0d3d802a3fd0a89e |
|
MD5 | b51e2fdee1d746d4b6ca5a13ed9fc06e |
|
BLAKE2b-256 | db0c5e8fd40e42dd75987e2c063987340d73295b319b469abc4b9a62bdb4af2d |