Skip to content

Fix WAGTAILADMIN_BASE_URL warning in Django system checks #175

@matrixise

Description

@matrixise

Problem

When running tests or Django system checks, a warning appears:

WARNINGS:
?: (wagtailadmin.W003) The WAGTAILADMIN_BASE_URL setting is not defined
	HINT: This should be the base URL used to access the Wagtail admin site. Without this, admin URLs outside of the admin (e.g. notification emails and the user bar) will not display correctly.

Root Cause

The project defines BASE_URL = "https://python.ie" in pythonie/pythonie/settings/base.py, but Wagtail expects the setting to be named WAGTAILADMIN_BASE_URL.

Impact

Without WAGTAILADMIN_BASE_URL, admin URLs appearing outside the admin interface (such as in notification emails and the user bar) may not display correctly.

Solution

Add WAGTAILADMIN_BASE_URL setting to the Django settings files:

  1. base.py: Set WAGTAILADMIN_BASE_URL = BASE_URL for production (https://python.ie)
  2. tests.py: Override with WAGTAILADMIN_BASE_URL = "http://testserver" for tests
  3. dev.py: Override with WAGTAILADMIN_BASE_URL = "http://localhost:8000" for local development

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions