From 90c9b3311e321cf93017580e2cac4fb83f480f88 Mon Sep 17 00:00:00 2001 From: Timothy Hobbs Date: Mon, 23 Oct 2023 12:47:05 +0200 Subject: [PATCH] Reverse order of local_settings loading in order to allow adding new installed apps --- docs/standalone.rst | 2 ++ standalone/config/local_settings.py | 1 + standalone/config/settings.py | 5 ----- standalone/config/wsgi.py | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 standalone/config/local_settings.py diff --git a/docs/standalone.rst b/docs/standalone.rst index 138e931b..3e4c4914 100644 --- a/docs/standalone.rst +++ b/docs/standalone.rst @@ -89,6 +89,8 @@ An example `local_settings` configuration for utilizing AWS SES for email: .. code-block:: python + + from .settings import * import os DEFAULT_FROM_EMAIL = "support@bitswan.space" diff --git a/standalone/config/local_settings.py b/standalone/config/local_settings.py new file mode 100644 index 00000000..7d7765a7 --- /dev/null +++ b/standalone/config/local_settings.py @@ -0,0 +1 @@ +from .settings import * diff --git a/standalone/config/settings.py b/standalone/config/settings.py index 715372f9..1c4e326e 100644 --- a/standalone/config/settings.py +++ b/standalone/config/settings.py @@ -229,8 +229,3 @@ MEDIA_ROOT = '/data/media' # for Django 3.2+, set default for autofields: DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' - -try: - from .local_settings import * -except ImportError: - pass diff --git a/standalone/config/wsgi.py b/standalone/config/wsgi.py index ef704eb8..1d41adf4 100644 --- a/standalone/config/wsgi.py +++ b/standalone/config/wsgi.py @@ -12,6 +12,6 @@ from django.core.wsgi import get_wsgi_application import os -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "standalone.config.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "standalone.config.local_settings") application = get_wsgi_application()