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"
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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd725c81fa26a181e82bf6a523bd2b1452666c8cac5fe2707d34cc7f48acee7f |
|
MD5 | e0a89bf109e353a8937a6f719638878b |
|
BLAKE2b-256 | 4b9bc747098bee3d494a6aa34faf65831f8031cd9135b7dbb5802ea9f3e62868 |
Hashes for wagtailimagecaptions-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf31245322558d718ed8987e18c5ccfe01263c5a333f38b6fc7c30fa55fb9347 |
|
MD5 | 677ebf8bf9e05f62104c232da7625ae2 |
|
BLAKE2b-256 | 4836ed02781e8ce180736eb0f2bf668ffa228d4ac508b148aae2979a69eb02a6 |