-
Notifications
You must be signed in to change notification settings - Fork 80
fix: Django52 use STORAGES instead of DEFAULT_FILE_STORAGE and STATICFILES_STORAGE #2844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
7ab9ce3
2ae19b9
475f37b
e403c34
3d3bd4d
98dd8e0
4328721
4743ef3
1f49a22
ef8a1e9
36022e0
dd3301a
1408832
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -456,7 +456,14 @@ | |||||||||
| FILE_STORAGE_BACKEND = {} | ||||||||||
| EXTRA_APPS = [] | ||||||||||
| SESSION_EXPIRE_AT_BROWSER_CLOSE = False | ||||||||||
| STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage" | ||||||||||
| STORAGES = { | ||||||||||
| "default": { | ||||||||||
| "BACKEND": "django.core.files.storage.FileSystemStorage", | ||||||||||
| }, | ||||||||||
| "staticfiles": { | ||||||||||
| "BACKEND": "django.contrib.staticfiles.storage.ManifestStaticFilesStorage", | ||||||||||
| }, | ||||||||||
| } | ||||||||||
| CACHES = { | ||||||||||
| "default": { | ||||||||||
| "BACKEND": "django.core.cache.backends.locmem.LocMemCache", | ||||||||||
|
|
@@ -474,7 +481,9 @@ | |||||||||
| } | ||||||||||
| API_ROOT = None | ||||||||||
| MEDIA_STORAGE_BACKEND = { | ||||||||||
| "DEFAULT_FILE_STORAGE": "django.core.files.storage.FileSystemStorage", | ||||||||||
| "STORAGES": { | ||||||||||
| "default": {"BACKEND": STORAGES["default"]["BACKEND"]}, | ||||||||||
| }, | ||||||||||
|
||||||||||
| "STORAGES": { | |
| "default": {"BACKEND": STORAGES["default"]["BACKEND"]}, | |
| }, | |
| "STORAGES": STORAGES |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,10 +43,16 @@ | |
| EMAIL_BACKEND = "django.core.mail.backends.filebased.EmailBackend" | ||
| EMAIL_FILE_PATH = "/tmp/credentials-emails" | ||
|
|
||
| DEFAULT_FILE_STORAGE = os.environ.get("DEFAULT_FILE_STORAGE", "django.core.files.storage.FileSystemStorage") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. defaultfile_storage = os.environ.get("DEFAULT_FILE_STORAGE", "django.core.files.storage.FileSystemStorage")
if defaultfile_storage:
STORAGES["default"]["BACKEND"] = defaultfile_storage |
||
| MEDIA_URL = os.environ.get("MEDIA_URL", "/media/") | ||
| STORAGES = { | ||
| "default": { | ||
| "BACKEND": "django.core.files.storage.FileSystemStorage", | ||
| }, | ||
| "staticfiles": { | ||
| "BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage", | ||
| }, | ||
| } | ||
|
||
|
|
||
| STATICFILES_STORAGE = os.environ.get("STATICFILES_STORAGE", "django.contrib.staticfiles.storage.StaticFilesStorage") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. staticfiles_storage = os.environ.get('STATICFILES_STORAGE', 'django.contrib.staticfiles.storage.StaticFilesStorage')
if staticfiles_storage:
STORAGES["staticfiles"]["BACKEND"] = staticfiles_storage |
||
| MEDIA_URL = os.environ.get("MEDIA_URL", "/media/") | ||
| STATIC_URL = os.environ.get("STATIC_URL", "/static/") | ||
|
|
||
| # OAuth2 variables specific to social-auth/SSO login use case. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,7 +35,16 @@ | |
|
|
||
| # Local Directories | ||
| TEST_ROOT = path("test_root") | ||
| DEFAULT_FILE_STORAGE = "django.core.files.storage.FileSystemStorage" | ||
|
|
||
| STORAGES = { | ||
| "default": { | ||
| "BACKEND": "django.core.files.storage.FileSystemStorage", | ||
| }, | ||
| "staticfiles": { | ||
| "BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage", | ||
| }, | ||
| } | ||
|
|
||
|
||
| MEDIA_ROOT = str(TEST_ROOT / "uploads") | ||
| MEDIA_URL = "/static/uploads/" | ||
|
|
||
|
|
@@ -49,7 +58,6 @@ | |
| "JWT_AUDIENCE": SOCIAL_AUTH_EDX_OAUTH2_KEY, | ||
| } | ||
| ) | ||
| STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage" | ||
|
|
||
| # Verifiable Credentials | ||
| ENABLE_VERIFIABLE_CREDENTIALS = True | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.