File tree Expand file tree Collapse file tree 5 files changed +21
-82
lines changed
Expand file tree Collapse file tree 5 files changed +21
-82
lines changed Original file line number Diff line number Diff line change 6363 make static
6464 make tests
6565 - name : Run code coverage
66- if : matrix.python-version == '3.12' && matrix.django-version == 'django52 '
66+ if : matrix.python-version == '3.12' && matrix.django-version == 'django42 '
6767 uses : codecov/codecov-action@v5
6868 with :
6969 flags : unittests
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33from os .path import abspath , dirname , join
44
55from corsheaders .defaults import default_headers as corsheaders_default_headers
6- import django
76from django .conf .global_settings import LANGUAGES_BIDI
87from edx_toggles .toggles import WaffleSwitch
98from edx_django_utils .plugins import get_plugin_apps , add_plugins
462461EXTRA_APPS = []
463462SESSION_EXPIRE_AT_BROWSER_CLOSE = False
464463
465- DEFAULT_FILE_STORAGE_BACKEND = "django.core.files.storage.FileSystemStorage"
466- STATICFILES_STORAGE_BACKEND = "django.contrib.staticfiles.storage.StaticFilesStorage"
467-
468- if django .VERSION >= (4 , 2 ):
469- # Use new STORAGES setting (available from Django 4.2)
470- STORAGES = {
471- "default" : {
472- "BACKEND" : DEFAULT_FILE_STORAGE_BACKEND ,
473- },
474- "staticfiles" : {
475- "BACKEND" : STATICFILES_STORAGE_BACKEND ,
476- },
477- }
478- else :
479- # For Django < 4.2 or packages still using legacy settings
480- DEFAULT_FILE_STORAGE = DEFAULT_FILE_STORAGE_BACKEND
481- STATICFILES_STORAGE = STATICFILES_STORAGE_BACKEND
464+ STORAGES = {
465+ "default" : {
466+ "BACKEND" : "django.core.files.storage.FileSystemStorage" ,
467+ },
468+ "staticfiles" : {
469+ "BACKEND" : "django.contrib.staticfiles.storage.ManifestStaticFilesStorage" ,
470+ },
471+ }
482472
483473CACHES = {
484474 "default" : {
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+ DEFAULT_FILE_STORAGE = os .environ .get (STORAGES [ "default" ][ "BACKEND" ] , "django.core.files.storage.FileSystemStorage" )
4747MEDIA_URL = os .environ .get ("MEDIA_URL" , "/media/" )
4848
49- STATICFILES_STORAGE = os .environ .get ("STATICFILES_STORAGE" , "django.contrib.staticfiles.storage.StaticFilesStorage" )
49+ STATICFILES_STORAGE = os .environ .get (
50+ STORAGES ["staticfiles" ]["BACKEND" ], "django.contrib.staticfiles.storage.StaticFilesStorage"
51+ )
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 3636# Local Directories
3737TEST_ROOT = path ("test_root" )
3838
39- DEFAULT_FILE_STORAGE_BACKEND = "django.core.files.storage.FileSystemStorage"
40- STATICFILES_STORAGE_BACKEND = "django.contrib.staticfiles.storage.StaticFilesStorage"
41-
42- if django .VERSION >= (4 , 2 ):
43- # Use new STORAGES setting (available from Django 4.2)
44- STORAGES = {
45- "default" : {
46- "BACKEND" : DEFAULT_FILE_STORAGE_BACKEND ,
47- },
48- "staticfiles" : {
49- "BACKEND" : STATICFILES_STORAGE_BACKEND ,
50- },
51- }
52- else :
53- # For Django < 4.2 or packages still using legacy settings
54- DEFAULT_FILE_STORAGE = DEFAULT_FILE_STORAGE_BACKEND
55- STATICFILES_STORAGE = STATICFILES_STORAGE_BACKEND
56-
39+ STORAGES = {
40+ "default" : {
41+ "BACKEND" : "django.core.files.storage.FileSystemStorage" ,
42+ },
43+ "staticfiles" : {
44+ "BACKEND" : "django.contrib.staticfiles.storage.StaticFilesStorage" ,
45+ },
46+ }
5747MEDIA_ROOT = str (TEST_ROOT / "uploads" )
5848MEDIA_URL = "/static/uploads/"
5949
You can’t perform that action at this time.
0 commit comments