[extensions-web/wip/ne0sight: 3/4] settings: improve static_root configuration




commit 72fce9d95cd6cf257ee1213d8a1dc62eb50e7cbe
Author: Yuri Konotopov <ykonotopov gnome org>
Date:   Mon May 9 22:05:10 2022 +0400

    settings: improve static_root configuration

 sweettooth/settings.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/sweettooth/settings.py b/sweettooth/settings.py
index 2399425..6b9ef4a 100644
--- a/sweettooth/settings.py
+++ b/sweettooth/settings.py
@@ -204,8 +204,8 @@ if not DEBUG and not NO_SECURE_SETTINGS:
     SECURE_PROXY_SSL_HEADER = ('HTTPS', 'https')
     SECURE_SSL_REDIRECT = False
 
-if DEBUG and not NO_STATICFILES_SETTINGS:
+if 'EGO_STATIC_ROOT' in os.environ:
+    STATIC_ROOT = os.getenv('EGO_STATIC_ROOT')
+elif DEBUG and not NO_STATICFILES_SETTINGS:
     STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage"
     STATIC_ROOT = None
-elif 'STATIC_ROOT' not in locals():
-    STATIC_ROOT = os.getenv('EGO_STATIC_ROOT')


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