Skip to content

Commit

Permalink
fix(deps): Mise à jour de la config pour django-storage (#1419)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn authored Aug 27, 2024
1 parent 5f2aa1f commit e7805c7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
4 changes: 3 additions & 1 deletion config/settings/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion config/settings/staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion config/settings/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit e7805c7

Please sign in to comment.