Skip to main content

Adds ability to use placeholder images for local development

Project description

PyPI version

wagtial placeholder images

This is a package for using placeholder images when developing which can be useful if you're storing them on a server and don't want to download them or link directly to the server when working locally.


First download the package:

pip install wagtail-placeholder-images

Then there's two options. If you're using your own custom image model you can use PlaceholderRenditionMixin like so:

from wagtail.images.models import AbstractImage
from wagtail_placeholder_images.mixins import PlaceholderRenditionMixin

class CustomImage(PlaceholderRenditionMixin, AbstractImage):
    admin_form_fields = Image.admin_form_fields + (
        # Then add the field names here to make them appear in the form:
        # 'caption',

If you're using the standard Wagtail Image model you can monkey patch it:

from wagtail.images.models import AbstractImage
from wagtail_placeholder_images.mixins import PlaceholderRenditionMixin

AbstractImage.get_placeholder_rendition = PlaceholderRenditionMixin.get_placeholder_rendition
AbstractImage.get_rendition = PlaceholderRenditionMixin.get_rendition

Then you have to set WAGTAIL_PLACEHOLDERIMAGES_DUMMY to True and use your desired placeholder source by setting WAGTAIL_PLACEHOLDERIMAGES_SOURCE. This should be done in your development settings file, so this doesn't get enabled on your servers. E.g.



That should be it!

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

wagtail-placeholder-images-0.1.1.tar.gz (3.3 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page