File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,14 @@ def get_env_setting(setting):
1818 error_msg = "Set the %s env variable" % setting
1919 raise ImproperlyConfigured (error_msg )
2020
21+ STORAGES = {
22+ "default" : {
23+ "BACKEND" : "django.core.files.storage.FileSystemStorage" ,
24+ },
25+ "staticfiles" : {
26+ "BACKEND" : "django.contrib.staticfiles.storage.StaticFilesStorage" ,
27+ },
28+ }
2129
2230# Keep track of the names of settings that represent dicts. Instead of overriding the values in settings.py,
2331# the values read from disk should UPDATE the pre-configured dicts.
@@ -35,8 +43,19 @@ def get_env_setting(setting):
3543 if value :
3644 vars ()[key ].update (value )
3745
46+ # Fallback for DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings.
47+ # If these keys are present in the YAML config, use them to override the default storage backends.
48+ default_backend = config_from_yaml .pop ('DEFAULT_FILE_STORAGE' , None )
49+ static_backend = config_from_yaml .pop ('STATICFILES_STORAGE' , None )
50+
3851 vars ().update (config_from_yaml )
3952
53+ if default_backend :
54+ STORAGES ['default' ]['BACKEND' ] = default_backend
55+
56+ if static_backend :
57+ STORAGES ['staticfiles' ]['BACKEND' ] = static_backend
58+
4059LOGGING = get_logger_config (LOG_DIR ,
4160 logging_env = LOGGING_ENV ,
4261 syslog_addr = (SYSLOG_SERVER , 514 ),
You can’t perform that action at this time.
0 commit comments