Skip to content

Commit 12f50cf

Browse files
matrixiseclaude
andauthored
fix: Add WAGTAILADMIN_BASE_URL setting to resolve Wagtail warning (#176)
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 <noreply@anthropic.com>
1 parent 45a9a71 commit 12f50cf

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

pythonie/pythonie/settings/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
# e.g. in notification emails. Don't include '/admin' or a trailing slash
3636
BASE_URL = "https://python.ie"
3737

38+
# Wagtail admin base URL for admin URLs outside the admin interface
39+
# (e.g. notification emails and the user bar)
40+
WAGTAILADMIN_BASE_URL = BASE_URL
41+
3842
# Application definition
3943

4044
INSTALLED_APPS = (

pythonie/pythonie/settings/dev.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
1212

13+
# Override Wagtail admin base URL for local development
14+
WAGTAILADMIN_BASE_URL = "http://localhost:8000"
15+
1316
# SQLite (simplest install)
1417
DATABASES = {
1518
"default": {

pythonie/pythonie/settings/tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
1212

13+
# Override Wagtail admin base URL for tests
14+
WAGTAILADMIN_BASE_URL = "http://testserver"
15+
1316
# Use PostgreSQL if DATABASE_URL is set (for CI), otherwise use SQLite (for local tests)
1417
if os.getenv("DATABASE_URL"):
1518
DATABASES = {"default": dj_database_url.config(conn_max_age=500)}

0 commit comments

Comments
 (0)