From e7805c785201e311c6ae708c069b7cff59aada59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Odini?= Date: Tue, 27 Aug 2024 17:01:34 +0200 Subject: [PATCH] =?UTF-8?q?fix(deps):=20Mise=20=C3=A0=20jour=20de=20la=20c?= =?UTF-8?q?onfig=20pour=20django-storage=20(#1419)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/settings/base.py | 5 ++++- config/settings/prod.py | 4 +++- config/settings/staging.py | 4 +++- config/settings/test.py | 4 +++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/config/settings/base.py b/config/settings/base.py index b0c83d67c..5382a0c72 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -64,7 +64,10 @@ "compressor.finders.CompressorFinder", ] -STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" +STORAGES = { + "default": {"BACKEND": "django.core.files.storage.FileSystemStorage"}, # default + "staticfiles": {"BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage"}, +} STATICFILES_FINDERS += ["compressor.finders.CompressorFinder"] diff --git a/config/settings/prod.py b/config/settings/prod.py index 1fd992357..f2b277045 100644 --- a/config/settings/prod.py +++ b/config/settings/prod.py @@ -21,7 +21,9 @@ SECURE_SSL_REDIRECT = env.str("SECURE_SSL_REDIRECT", True) MEDIA_URL = f"https://{S3_STORAGE_ENDPOINT_DOMAIN}/" # noqa -DEFAULT_FILE_STORAGE = "lemarche.utils.s3boto.S3BotoStorage" + +# flake8: noqa F405 +STORAGES |= {"default": {"BACKEND": "storages.backends.s3.S3Storage"}} # Sentry diff --git a/config/settings/staging.py b/config/settings/staging.py index 6e905d009..679f154f2 100644 --- a/config/settings/staging.py +++ b/config/settings/staging.py @@ -24,7 +24,9 @@ SECURE_SSL_REDIRECT = env.bool("SECURE_SSL_REDIRECT", True) MEDIA_URL = f"https://{S3_STORAGE_ENDPOINT_DOMAIN}/" # noqa -DEFAULT_FILE_STORAGE = "lemarche.utils.s3boto.S3BotoStorage" + +# flake8: noqa F405 +STORAGES |= {"default": {"BACKEND": "storages.backends.s3.S3Storage"}} # Sentry diff --git a/config/settings/test.py b/config/settings/test.py index ef69c2bbf..b18c9168a 100644 --- a/config/settings/test.py +++ b/config/settings/test.py @@ -9,7 +9,9 @@ logging.disable(logging.CRITICAL) # `ManifestStaticFilesStorage` (used in base settings) requires `collectstatic` to be run. -STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage" +# flake8: noqa F405 +STORAGES |= {"staticfiles": {"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"}} + COMPRESS_OFFLINE = False EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"