Defend against MAIN_DOMAIN being unset in prod

This commit is contained in:
Andrew Godwin 2023-01-14 12:18:35 -07:00
parent 1ffcd5e6d1
commit 3f3e815407
1 changed files with 3 additions and 0 deletions

View File

@ -326,6 +326,9 @@ MEDIA_URL = SETUP.MEDIA_URL
MEDIA_ROOT = SETUP.MEDIA_ROOT
MAIN_DOMAIN = SETUP.MAIN_DOMAIN
if not DEBUG and MAIN_DOMAIN == "example.com":
raise ValueError("You must set a TAKAHE_MAIN_DOMAIN!")
# Debug toolbar should only be loaded at all when debug is on
if DEBUG and SETUP.DEBUG_TOOLBAR:
INSTALLED_APPS.append("debug_toolbar")