wagtailimagecaptions


Namewagtailimagecaptions JSON
Version 0.2.2 PyPI version JSON
download
home_pageNone
SummaryA Django app for extending the Wagtail Image model to add captions and alt fields as
upload_time2024-08-20 11:31:14
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://github.com/newshour/wagtailimagecaptions/assets/14984514/278f5d01-7f2e-48a8-98fd-aaaa6c2d6b8c)

## Installing

Install using pip:

```sh
pip install wagtailimagecaptions
```

### Settings

In your settings file, add `wagtailimagecaptions` to `INSTALLED_APPS`:

```python
INSTALLED_APPS = [
    # ...
    "wagtailimagecaptions",
    # ...
]
```

You will also need to set a custom Image model in your setting files:

```python
# settings.py
WAGTAILIMAGES_IMAGE_MODEL = "wagtailimagecaptions.CaptionedImage"
```

### Migrating

Heads up! If you have existing images, you will need to create a [data migration operation](https://docs.wagtail.org/en/latest/advanced_topics/images/custom_image_model.html#migrating-from-the-builtin-image-model) 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:

```python
{% load wagtailcore_tags %}

<img src="{{ image.url }}" alt="{{ image.alt }}">{{ image.caption|richtext }}
```

#### Adding date paths to image uploads.

To add date paths to the image upload path, you can set `WAGTIALIMAGECAPTIONS_UPLOAD_TO_DATE_PATH` in your Django settings file with a valid date format.

```python
# settings.py
WAGTIALIMAGECAPTIONS_UPLOAD_TO_DATE_PATH = "%Y/%m"
```
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "wagtailimagecaptions",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Stephan Rohde <appsupport@newshour.org>",
    "download_url": "https://files.pythonhosted.org/packages/14/9c/fa4f2ef72a4a36263f3b1e4a708d71493ebb55edfe226017e5707c9acb4f/wagtailimagecaptions-0.2.2.tar.gz",
    "platform": null,
    "description": "# Captions for Wagtail Images\n\nA Django app for extending the Wagtail Image model to add captions and alt fields as\nwell as the extraction of IPTC image meta data.\n\n![screenshot](https://github.com/newshour/wagtailimagecaptions/assets/14984514/278f5d01-7f2e-48a8-98fd-aaaa6c2d6b8c)\n\n## Installing\n\nInstall using pip:\n\n```sh\npip install wagtailimagecaptions\n```\n\n### Settings\n\nIn your settings file, add `wagtailimagecaptions` to `INSTALLED_APPS`:\n\n```python\nINSTALLED_APPS = [\n    # ...\n    \"wagtailimagecaptions\",\n    # ...\n]\n```\n\nYou will also need to set a custom Image model in your setting files:\n\n```python\n# settings.py\nWAGTAILIMAGES_IMAGE_MODEL = \"wagtailimagecaptions.CaptionedImage\"\n```\n\n### Migrating\n\nHeads up! If you have existing images, you will need to create a [data migration operation](https://docs.wagtail.org/en/latest/advanced_topics/images/custom_image_model.html#migrating-from-the-builtin-image-model) to move the old images into\nthe new model.\n\n## How to Use\n\nThe 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\nthe `alt`, `caption` and `credit` fields. All IPTC meta data  extracted is also stored in `iptc_data`.\n\nExample use in a template:\n\n```python\n{% load wagtailcore_tags %}\n\n<img src=\"{{ image.url }}\" alt=\"{{ image.alt }}\">{{ image.caption|richtext }}\n```\n\n#### Adding date paths to image uploads.\n\nTo add date paths to the image upload path, you can set `WAGTIALIMAGECAPTIONS_UPLOAD_TO_DATE_PATH` in your Django settings file with a valid date format.\n\n```python\n# settings.py\nWAGTIALIMAGECAPTIONS_UPLOAD_TO_DATE_PATH = \"%Y/%m\"\n```",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Django app for extending the Wagtail Image model to add captions and alt fields as",
    "version": "0.2.2",
    "project_urls": {
        "Home": "https://github.com/newshour/wagtailimagecaptions/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "45b415b1c14bee3682f23ec37e6802d3d2850d9bdc64ebde05b768faefce8d97",
                "md5": "0d64aa6869ce102ffbc841bd4396c70b",
                "sha256": "d6e9bef461c83446e613168b0237455e6a84be703371249eda81708517ff074f"
            },
            "downloads": -1,
            "filename": "wagtailimagecaptions-0.2.2-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0d64aa6869ce102ffbc841bd4396c70b",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 11943,
            "upload_time": "2024-08-20T11:31:11",
            "upload_time_iso_8601": "2024-08-20T11:31:11.453697Z",
            "url": "https://files.pythonhosted.org/packages/45/b4/15b1c14bee3682f23ec37e6802d3d2850d9bdc64ebde05b768faefce8d97/wagtailimagecaptions-0.2.2-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "149cfa4f2ef72a4a36263f3b1e4a708d71493ebb55edfe226017e5707c9acb4f",
                "md5": "e2c67adee26ef1c05d4ee850dec1ec81",
                "sha256": "22a2b0b8df83ad5929187ed067f1badb1cab3998d487f45ad7451ed12d0ebd68"
            },
            "downloads": -1,
            "filename": "wagtailimagecaptions-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e2c67adee26ef1c05d4ee850dec1ec81",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 11130,
            "upload_time": "2024-08-20T11:31:14",
            "upload_time_iso_8601": "2024-08-20T11:31:14.762659Z",
            "url": "https://files.pythonhosted.org/packages/14/9c/fa4f2ef72a4a36263f3b1e4a708d71493ebb55edfe226017e5707c9acb4f/wagtailimagecaptions-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-20 11:31:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "newshour",
    "github_project": "wagtailimagecaptions",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "wagtailimagecaptions"
}
        
Elapsed time: 0.35082s