Skip to main content

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.

screenshot

Installing

Settings

In your settings file, add wagtailmedia 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wagtailimagecaptions-0.1.1.tar.gz (8.6 kB view hashes)

Uploaded Source

Built Distribution

wagtailimagecaptions-0.1.1-py2.py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page