Skip to main content

Wagtail previews in headless mode.

Project description

Wagtail Headless Preview

Setup

Install using pip:

pip install wagtail-headless-preview

After installing the module, add wagtail_headless_preview to installed apps in your settings file:

INSTALLED_APPS = [
    ...
    'wagtail_headless_preview',
]

then configure the preview client URL.

For a multi-site setup, you can use HEADLESS_PREVIEW_CLIENT_URLS:

HEADLESS_PREVIEW_CLIENT_URLS = {
    'default': 'http://localhost:8020/',
    'site1.example.com': 'http://localhost:8020/',
    'site2.example.com': 'http://localhost:8021/',
}

For single sites, the configuration can be:

HEADLESS_PREVIEW_CLIENT_URLS = {
    'default': 'http://localhost:8020/',
}

Alternatively, you can use HEADLESS_PREVIEW_CLIENT_URL:

HEADLESS_PREVIEW_CLIENT_URL = 'http://localhost:8020/'

Usage

Add HeadlessPreviewMixin to your page class:

from wagtail_headless_preview.models import HeadlessPreviewMixin

class MyWonderfulPage(HeadlessPreviewMixin, Page):
    pass

Credits

  • Matthew Westcott (@gasman), initial proof of concept
  • Karl Hobley (@kaedroho), improvements

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-headless-preview-0.0.2.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

wagtail_headless_preview-0.0.2-py2-none-any.whl (6.1 kB view hashes)

Uploaded Python 2

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