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:
{% load wagtailcore_tags %}
<img src="{{ image.url }}" alt="{{ image.alt }}">{{ image.caption|richtext }}
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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39b5d2a3c72de458e7b15262489eb99850679ff90278a99d8c32c556cc56c344 |
|
MD5 | 3bc3b8153c930719956deb4f3f5f61ac |
|
BLAKE2b-256 | c8fc40627271004763e8ad027f7be8fc4f007613797a401ddf2a110fa32c4980 |
Hashes for wagtailimagecaptions-0.1.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b824bcdfb217be98c3f8c9894ac951f0de5c1e4c0df72b7ac417dc4c1d5ad65 |
|
MD5 | b63e7b68ec9f01a7a1100f523a24bcf1 |
|
BLAKE2b-256 | 369b1cbf086206090f3bd2eb3af33f7afe30b9ce6996a8e589a4455f65446e16 |