File tree Expand file tree Collapse file tree 4 files changed +26
-6
lines changed
Expand file tree Collapse file tree 4 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 456456FILE_STORAGE_BACKEND = {}
457457EXTRA_APPS = []
458458SESSION_EXPIRE_AT_BROWSER_CLOSE = False
459- STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"
459+ STORAGES = {
460+ "default" : {"BACKEND" : "django.core.files.storage.FileSystemStorage" },
461+ "staticfiles" : {"BACKEND" : "django.contrib.staticfiles.storage.ManifestStaticFilesStorage" },
462+ }
460463CACHES = {
461464 "default" : {
462465 "BACKEND" : "django.core.cache.backends.locmem.LocMemCache" ,
474477}
475478API_ROOT = None
476479MEDIA_STORAGE_BACKEND = {
477- "DEFAULT_FILE_STORAGE" : "django.core.files.storage.FileSystemStorage" ,
480+ "STORAGES" : {
481+ "default" : {"BACKEND" : STORAGES ["default" ]["BACKEND" ]},
482+ },
478483 "MEDIA_ROOT" : MEDIA_ROOT ,
479484 "MEDIA_URL" : MEDIA_URL ,
480485}
Original file line number Diff line number Diff line change 4343EMAIL_BACKEND = "django.core.mail.backends.filebased.EmailBackend"
4444EMAIL_FILE_PATH = "/tmp/credentials-emails"
4545
46- DEFAULT_FILE_STORAGE = os .environ .get ("DEFAULT_FILE_STORAGE" , "django.core.files.storage.FileSystemStorage" )
46+ STORAGES ["default" ]["BACKEND" ] = os .environ .get (
47+ STORAGES ["default" ]["BACKEND" ], "django.core.files.storage.FileSystemStorage"
48+ )
4749MEDIA_URL = os .environ .get ("MEDIA_URL" , "/media/" )
4850
49- STATICFILES_STORAGE = os . environ . get ( "STATICFILES_STORAGE" , " django.contrib.staticfiles.storage.StaticFilesStorage")
51+ STORAGES [ "staticfiles" ][ "BACKEND" ] = " django.contrib.staticfiles.storage.StaticFilesStorage"
5052STATIC_URL = os .environ .get ("STATIC_URL" , "/static/" )
5153
5254# OAuth2 variables specific to social-auth/SSO login use case.
Original file line number Diff line number Diff line change 4242 if value :
4343 vars ()[key ].update (value )
4444
45+ if "DEFAULT_FILE_STORAGE" in config_from_yaml and "default" not in STORAGES :
46+ STORAGES ["default" ] = {"BACKEND" : config_from_yaml .pop ("DEFAULT_FILE_STORAGE" )}
47+ vars ().update (STORAGES )
48+
49+ if "STATICFILES_STORAGE" in config_from_yaml and "staticfiles" not in STORAGES :
50+ STORAGES ["staticfiles" ] = {"BACKEND" : config_from_yaml .pop ("STATICFILES_STORAGE" )}
51+ vars ().update (STORAGES )
52+
4553 vars ().update (config_from_yaml )
4654
55+ if "DEFAULT_FILE_STORAGE" in FILE_STORAGE_BACKEND :
56+ MEDIA_STORAGE_BACKEND ["STORAGES" ] = {"default" : {"BACKEND" : MEDIA_STORAGE_BACKEND .pop ("DEFAULT_FILE_STORAGE" )}}
57+
4758 # Load the files storage backend settings for django storages
4859 vars ().update (FILE_STORAGE_BACKEND )
4960
Original file line number Diff line number Diff line change 3535
3636# Local Directories
3737TEST_ROOT = path ("test_root" )
38- DEFAULT_FILE_STORAGE = "django.core.files.storage.FileSystemStorage"
38+ STORAGES ["default" ]["BACKEND" ] = os .environ .get (
39+ STORAGES ["default" ]["BACKEND" ], "django.core.files.storage.FileSystemStorage"
40+ )
3941MEDIA_ROOT = str (TEST_ROOT / "uploads" )
4042MEDIA_URL = "/static/uploads/"
4143
4951 "JWT_AUDIENCE" : SOCIAL_AUTH_EDX_OAUTH2_KEY ,
5052 }
5153)
52- STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage"
54+ STORAGES [ "staticfiles" ][ "BACKEND" ] = "django.contrib.staticfiles.storage.StaticFilesStorage"
5355
5456# Verifiable Credentials
5557ENABLE_VERIFIABLE_CREDENTIALS = True
You can’t perform that action at this time.
0 commit comments