Skip to content

Commit

Permalink
🚜 Use STORAGES["staticfiles"] instead of STATICFILES_STORAGE
Browse files Browse the repository at this point in the history
  • Loading branch information
kimihito committed May 22, 2024
1 parent 65f3503 commit c9e2e74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion config/settings.py-tpl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ USE_TZ = True
STATIC_ROOT = str(BASE_DIR.joinpath("static"))
STATIC_URL = "/static/"
STATICFILES_DIRS = (str(BASE_DIR.joinpath("frontend")),)
# STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
# STORAGES = {
# "staticfiles": {
# "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage"
# }
# }

MEDIA_URL = "/media/"
MEDIA_ROOT = str(BASE_DIR.joinpath("media"))
Expand Down
9 changes: 6 additions & 3 deletions conftest.py-tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ def use_test_settings(settings):
# User a faster password hasher
settings.PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]

settings.STATICFILES_STORAGE = (
"django.contrib.staticfiles.storage.StaticFilesStorage"
)
settings.STORAGES = {
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"
}
}


settings.WHITENOISE_AUTOREFRESH = True

0 comments on commit c9e2e74

Please sign in to comment.