diff --git a/program/admin.py b/program/admin.py index f3af2da1cc7eade1aa8cc0dbbc415ac62f70d16e..542de6e715c84e3ab31e858b8738e03f5046f28e 100644 --- a/program/admin.py +++ b/program/admin.py @@ -21,6 +21,11 @@ from program.models import ( Type, ) +# This URL is used in the Django admin backend to "View [the] Site". +# Steering doesn’t have a public facing website so it doesn’t make sense to keep the default. +admin.site.site_url = settings.SITE_WEBSITE_URL +admin.site.site_header = settings.SITE_NAME + @admin.register(Category, FundingCategory, MusicFocus, Topic, Type) class AdminWithNameSlugIsActive(admin.ModelAdmin): diff --git a/steering/settings.py b/steering/settings.py index 084ab4d11f51234f50d0e86b13deba1ea8edd794..b3d9acbf153066a9447601289c9f650de8b27183 100644 --- a/steering/settings.py +++ b/steering/settings.py @@ -214,6 +214,12 @@ SITE_URL = os.getenv( "SITE_URL", default=f"{AURA_PROTO}://{AURA_HOST}:{PORT}" if PORT else f"{AURA_PROTO}://{AURA_HOST}", ) +# SITE_URL and SITE_WEBSITE_URL are likely the same (hence the default), +# but may differ in some setups that serve steering on a separate domain +# instead of the default sub-path. +# This will usually point to the URL of the dashboard. +SITE_WEBSITE_URL = os.getenv("SITE_WEBSITE_URL", default=SITE_URL) +SITE_NAME = os.getenv("SITE_NAME", default="AURA Backend") if AURA_PROTO == "https": CSRF_TRUSTED_ORIGINS = [f"{AURA_PROTO}://{AURA_HOST}"]