Skip to main content

wagtail-prose-editor-images

A native Wagtail Image Chooser button for django-prose-editor. It connects the Prose editor's Image extension to Wagtail's existing chooser modal, adds editor styles, and resolves the selected image URL through a permission-checked endpoint.

This package enhances the editor experience; it does not replace Wagtail's image model, media storage, rendition policy, or the front-end HTML/CSS of your site.

English · Русский · Deutsch · Español · Français · Italiano · Português (Brasil) · Nederlands · Polski · Türkçe · 简体中文 · 日本語 · 한국어

Prose editor image chooser

Features

  • Opens Wagtail's standard image chooser from the Prose toolbar.
  • Inserts the selected image using a configured Wagtail rendition URL (default: width-1200) returned by the permission-checked endpoint.
  • Loads CSS/JavaScript through Wagtail admin hooks and follows the admin's neutral light/dark appearance.
  • Checks permission to choose that specific image, not just permission to enter the admin. A user restricted by Wagtail Collections must not receive URLs for images they cannot choose.
  • Provides improved inline and block code styling alongside the image integration.

Audit/release status

This source bundle prepares version 0.2.3 for a possible next release. Static syntax/package checks have been run, but a full Django/Wagtail integration suite has not run in the bundle build environment. Do not upload to PyPI until the release checklist in ../../04-docs/UPGRADE_AND_RELEASE.md is complete.

Requirements

Package metadata declares wagtail>=6.0 and django-prose-editor>=0.26. Compatibility with all combinations is not covered by an automated test matrix in this source bundle. Confirm the exact versions used by your site, especially after major Wagtail upgrades.

Installation

pip install wagtail-prose-editor-images

Enable the apps in INSTALLED_APPS:

INSTALLED_APPS = [
    # ... Django and Wagtail apps ...
    "wagtail.images",
    "django_prose_editor",
    "wagtail_prose_editor_images",
    # ... your page apps ...
]

The plugin registers its admin JavaScript, CSS, and URL through Wagtail hooks. Add no manual URL route unless your project uses a custom admin setup that bypasses the hooks.

Enable the Image extension

The field must enable Prose's Image extension:

from django_prose_editor.fields import ProseEditorField
from wagtail.models import Page

class ArticlePage(Page):
    body = ProseEditorField(
        extensions={
            "Bold": True,
            "Italic": True,
            "Heading": {"levels": [2, 3]},
            "Image": True,
            "Code": True,
            "CodeBlock": True,
        }
    )

Use your actual page model and the extension set already supported by your installed django-prose-editor version. This example shows the minimum relevant change: "Image": True.

Image permissions and URL behavior

The endpoint is an admin endpoint and requires Wagtail admin access plus the image's choose permission. An inaccessible or missing image returns the same not-found response to avoid exposing private image IDs. By default, the endpoint asks the configured Wagtail image model for a width-1200 rendition. Change the spec with WAGTAIL_PROSE_EDITOR_IMAGES_RENDITION_SPEC if your templates and storage policy need another size.

Disk-quota note: a rendition can create an additional file on disk. Keep the spec allowlist in your concrete image model intentional, and estimate the number and size of images inserted into article bodies before choosing a new default. In this project, width-1200 is outside the CustomImage pass-through list so that public article images do not silently receive the multi-megabyte original. If rendition generation fails, the endpoint logs the error and falls back to the original as a last resort; monitor logs and storage errors because that fallback can be large.

If your deployment uses private media storage, signed URLs, a CDN, or custom image delivery, review whether the returned rendition URL matches that architecture. The plugin cannot make a public media URL private after it has been inserted into public article HTML. Moving or renaming image files may also leave stale hard-coded URLs in already-saved HTML; a storage relocation must include a URL migration plan.

  • Use with wagtail-image-directories if you want new originals to be stored under images/<year>/<slug>/ and managed through the Image Navigator. Verify the concrete image model and migrations before uploading production content.
  • Use with wagtail-mptt-comments only if your comments' administrator responses or rich-text fields also use Prose and you need the same image chooser in those fields. The comments package is otherwise independent.
  • No dependency on the forum, desktop publisher, or comments database tables is introduced by this package.

Verification after installation

  1. Open a page using ProseEditorField in the Wagtail admin.
  2. Confirm the Image toolbar action opens the Wagtail chooser.
  3. Select an image from a Collection the user can access and confirm it inserts correctly.
  4. Repeat with a user who cannot choose an image in a restricted Collection; the endpoint should not return its URL.
  5. Confirm the article preview and public page style the inserted image as expected.

License and support

MIT. Source and issue tracker: GitHub. Include Python, Django, Wagtail, django-prose-editor, browser console errors, and relevant permission configuration in bug reports.

To install the candidate source in this bundle (rather than the already-published PyPI release), run from this package directory:

python -m pip install .
# For editable development instead:
python -m pip install -e .

pip install wagtail_prose_editor_images selects the version currently published on PyPI. The candidate version shown in pyproject.toml is not published by this archive operation; publish it only after the release checklist in ../../04-docs/UPGRADE_AND_RELEASE.md passes.

Metadata

Release files for wagtail-prose-editor-images 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wagtail-prose-editor-images 0.2.3
File Size Uploaded Provenance Actions
wagtail_prose_editor_images-0.2.3.tar.gz 12.0 kB Without provenance Details for wagtail_prose_editor_images-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wagtail-prose-editor-images 0.2.3
File Interpreter ABI Platform Actions
wagtail_prose_editor_images-0.2.3-py2.py3-none-any.whl Python 2, Python 3 none any Details for wagtail_prose_editor_images-0.2.3-py2.py3-none-any.whl

Total release size: 24.0 kB

Release files / wagtail_prose_editor_images-0.2.3.tar.gz

Download URL wagtail_prose_editor_images-0.2.3.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
125bd35c78748274429655dd12db2ac543d56fdabebf62e2ab391dbed7043d65
BLAKE2b-256 checksum
How to use checksums
b3e7a3103b885d304627e0ce478a262302c522916f468022476b1bf9ef2c2d02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / wagtail_prose_editor_images-0.2.3-py2.py3-none-any.whl

Download URL wagtail_prose_editor_images-0.2.3-py2.py3-none-any.whl
Size 12.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
84cbd56c75d465591e7161b9ca34e23fe08a116703891ea031865c4840f42c79
BLAKE2b-256 checksum
How to use checksums
3301d34850fcbff755bbaacdf391439051f1a4d9f16e4813b5abe1d7de28b733
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for wagtail-prose-editor-images 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page