[settings] Make it more complicated, why not

This commit is contained in:
bronsen 2024-11-21 19:46:35 +01:00
parent f3bdb36ca8
commit 1d44ea830e

View file

@ -4,6 +4,15 @@ from configurations import Configuration
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent
class EnableDebug(Configuration):
"""
Intended as a MIXIN
"""
DEBUG = True
INSTALLED_APPS = Configuration.INSTALLED_APPS + ["django_debug_toolbar"]
class Base(Configuration): class Base(Configuration):
DEBUG = False DEBUG = False
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
@ -22,7 +31,7 @@ class Base(Configuration):
USE_TZ = True USE_TZ = True
class Dev(Base): class Dev(EnableDebug, Base):
# Dangerous: disable host header validation # Dangerous: disable host header validation
ALLOWED_HOSTS = ["*"] ALLOWED_HOSTS = ["*"]
DATABASES = { DATABASES = {
@ -31,7 +40,6 @@ class Dev(Base):
"NAME": "db.sqlite3", "NAME": "db.sqlite3",
}, },
} }
DEBUG = True
INSTALLED_APPS = Base.INSTALLED_APPS + ["django_extensions"] INSTALLED_APPS = Base.INSTALLED_APPS + ["django_extensions"]