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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2487e4250e617c0b42b4b0c383e20af95b76e2db4bec2c83cb483bf74b9e6cb |
|
MD5 | f194f3961e0953cf8be6ddcc0ab35095 |
|
BLAKE2b-256 | b85fad449e39cfd063c4cb874401e979d7e2b7c0df6a9b27b9d39bc881e02c4d |
Hashes for wagtailimagecaptions-0.1.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f83ce4d01bba35d3f7b0e10fa05e17dfedfd60618bc22661bfb6af7e3c5c475c |
|
MD5 | 3f8abcb3fb419658380529593f985a8d |
|
BLAKE2b-256 | 6e4c32d315fd6efe3d4fd38b68fea97a3869f7f23ea381e6eae34b3c695317a9 |