From 8a9f2a24bb7f076f3a337f78be840870caad564b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Wirtel?= Date: Wed, 24 Dec 2025 10:34:47 +0100 Subject: [PATCH] fix: Add WAGTAILADMIN_BASE_URL setting to resolve Wagtail warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add WAGTAILADMIN_BASE_URL setting to all Django settings files to fix the wagtailadmin.W003 warning that appeared during system checks. The project had a BASE_URL setting but Wagtail expects the setting to be named WAGTAILADMIN_BASE_URL for admin URLs outside the admin interface. Changes: - base.py: Set WAGTAILADMIN_BASE_URL = BASE_URL (https://python.ie) - tests.py: Override with http://testserver for test environment - dev.py: Override with http://localhost:8000 for local development This ensures admin URLs in notification emails and the user bar will display correctly in all environments. Fixes #175 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- pythonie/pythonie/settings/base.py | 4 ++++ pythonie/pythonie/settings/dev.py | 3 +++ pythonie/pythonie/settings/tests.py | 3 +++ 3 files changed, 10 insertions(+) diff --git a/pythonie/pythonie/settings/base.py b/pythonie/pythonie/settings/base.py index cf463f7..7113b35 100644 --- a/pythonie/pythonie/settings/base.py +++ b/pythonie/pythonie/settings/base.py @@ -34,6 +34,10 @@ # e.g. in notification emails. Don't include '/admin' or a trailing slash BASE_URL = "https://python.ie" +# Wagtail admin base URL for admin URLs outside the admin interface +# (e.g. notification emails and the user bar) +WAGTAILADMIN_BASE_URL = BASE_URL + # Application definition INSTALLED_APPS = ( diff --git a/pythonie/pythonie/settings/dev.py b/pythonie/pythonie/settings/dev.py index acc5db5..d347b08 100644 --- a/pythonie/pythonie/settings/dev.py +++ b/pythonie/pythonie/settings/dev.py @@ -10,6 +10,9 @@ EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" +# Override Wagtail admin base URL for local development +WAGTAILADMIN_BASE_URL = "http://localhost:8000" + # SQLite (simplest install) DATABASES = { "default": { diff --git a/pythonie/pythonie/settings/tests.py b/pythonie/pythonie/settings/tests.py index aa6c9cb..3a6025a 100644 --- a/pythonie/pythonie/settings/tests.py +++ b/pythonie/pythonie/settings/tests.py @@ -10,6 +10,9 @@ EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" +# Override Wagtail admin base URL for tests +WAGTAILADMIN_BASE_URL = "http://testserver" + # SQLite (simplest install) DATABASES = { "default": {