fix django STATICFILES_STORAGE deprecation warning

This commit is contained in:
Gabriel Augendre 2023-04-29 22:41:14 +02:00
parent 6c4a1b40b1
commit 741d2adbf8
2 changed files with 17 additions and 2 deletions

View file

@ -196,11 +196,19 @@ USE_TZ = True
STATIC_URL = "static/"
STATIC_ROOT = env("STATIC_ROOT")
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
MEDIA_URL = "media/"
MEDIA_ROOT = BASE_DIR.parent / "media"
STORAGES = {
"default": {
"BACKEND": "django.core.files.storage.FileSystemStorage",
},
"staticfiles": {
"BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage",
},
}
AUTH_USER_MODEL = "common.User"
LOGIN_URL = "admin:login"

View file

@ -9,7 +9,14 @@ def _collectstatic():
@pytest.fixture()
def live_server(settings, live_server):
settings.STATICFILES_STORAGE = "whitenoise.storage.CompressedStaticFilesStorage"
settings.STORAGES = {
"default": {
"BACKEND": "django.core.files.storage.FileSystemStorage",
},
"staticfiles": {
"BACKEND": "whitenoise.storage.CompressedStaticFilesStorage",
},
}
return live_server