Skip to main content

Wagtail Site Check

A Wagtail app to check the configuration of Wagtail Sites.

Common issues with misconfigured Wagtail Sites are:

  • Failing Wagtail preview.
  • Live button pointing to wrong site.
  • On multi-language sites wrong active language and/or wrong content displayed.

When a Wagtail Site is misconfigured, developers like to be notified. This way, the issue can be addressed quickly. To scratch the itch, I created "Wagtail Site Check".

Wagtail Site Check provides:

  • A management command to check for misconfigured sites.
  • A management command to fix misconfigured sites.
  • A notification panel to show a misconfigured site warning on the Wagtail admin dashboard.

Installation

Install the package with pip:

python -m pip install wagtail-site-check

Add the app to your INSTALLED_APPS:

INSTALLED_APPS = [
    'wagtailsitecheck',
]

Wagtail Site Check uses ALLOWED_HOSTS and port 443 to create the list of allowed sites.

Optional: add ALLOWED_WAGTAIL_SITES to your settings to be specific:

ALLOWED_WAGTAIL_SITES = [  
    "a.com:443",
    "b.com:443",
    "c.com:443",
]

When managing multiple environments (DTAP), only list approved Wagtail sites for each environment, typically through environment variables.

Usage

The app provides two management commands: checksites and fixsites.

It also provides a SiteCheckNotificationPanel to add a warning to the Wagtail admin dashboard.

Check Sites

The checksites management command fails hard if an existing Wagtail Site object is not defined in ALLOWED_WAGTAIL_SITES.

python manage.py checksites

Run this command manually, or add it to your CI/CD pipeline. For example, just after migrate.

Fix Sites

The fixsites management command helps to re-configure the sites.

python manage.py fixsites
127.0.0.1:8000 is not in ALLOWED_WAGTAIL_SITES. Specify a number to update the site.
  
1: a.com:443
2: b.com:443
3: c.com:443
  
1
  
Updated 127.0.0.1:8000 -> a.com:443

SiteCheckNotificationPanel

To show a warning on the Wagtail admin dashboard add SiteCheckNotificationPanel to wagtail_hooks.py . The warning is only displayed if there are misconfigured sites.

from wagtail import hooks
from wagtailsitecheck.wagtail_hooks import SiteCheckNotificationPanel

@hooks.register('construct_homepage_panels')
def add_site_check_panel(request, panels):
    panels.append(SiteCheckNotificationPanel())

Metadata

Release files for wagtail-site-check 0.0.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-site-check 0.0.3
File Size Uploaded
wagtail_site_check-0.0.3.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wagtail-site-check 0.0.3
File Interpreter ABI Platform
wagtail_site_check-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / wagtail_site_check-0.0.3.tar.gz

Download URL wagtail_site_check-0.0.3.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
59de31568b4e61a16626803573d95b48e3519e523c81607e4bc096f120a78e36
BLAKE2b-256 checksum
How to use checksums
6e5ed881abcad4e5198f52d03454ed987956bef031f4dbae67ef7d1cc92a51e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.3

Release files / wagtail_site_check-0.0.3-py3-none-any.whl

Download URL wagtail_site_check-0.0.3-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18ffe10d5f54533eb04dc2175980520ea7da8b1e485e5f689b00b2e9f147ecb0
BLAKE2b-256 checksum
How to use checksums
0c27c602a628e30a5c07dc96b6c51879a75c72cdee0bb2ce629c363a3bf7559b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

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