[extensions-web/wip/api/v1: 12/12] settings: allow to add installed apps and middlewares using local settings




commit 3905a0b80ef28127c92935f8840d394c62c773e1
Author: Yuri Konotopov <ykonotopov gnome org>
Date:   Sun Nov 22 12:41:09 2020 +0400

    settings: allow to add installed apps and middlewares using local settings

 sweettooth/settings.py | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/sweettooth/settings.py b/sweettooth/settings.py
index 9cec5aaf..18109848 100644
--- a/sweettooth/settings.py
+++ b/sweettooth/settings.py
@@ -203,11 +203,18 @@ if os.getenv('EGO_EMAIL_URL'):
 NO_SECURE_SETTINGS = True if os.getenv('EGO_NO_SECURE_SETTINGS') else False
 NO_STATICFILES_SETTINGS = False
 
+APPEND_INSTALLED_APPS = PREPEND_MIDDLEWARE = ()
+
 try:
     from local_settings import *
 except ImportError:
     pass
 
+if APPEND_INSTALLED_APPS:
+    INSTALLED_APPS += APPEND_INSTALLED_APPS
+
+if PREPEND_MIDDLEWARE:
+    MIDDLEWARE = PREPEND_MIDDLEWARE + MIDDLEWARE
 
 # Enable secure settings in case DEBUG is disabled and NO_SECURE_SETTINGS is not set to True
 if not DEBUG and not NO_SECURE_SETTINGS:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]