Skip to content

Commit b3f85a6

Browse files
committed
Use ManifestStaticFilesStorage as default static files storage
1 parent b4d9cf3 commit b3f85a6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bakerydemo/settings/base.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,18 @@
182182
MEDIA_ROOT = os.path.join(PROJECT_DIR, "media")
183183
MEDIA_URL = "/media/"
184184

185+
# Default storage settings, with the staticfiles storage updated.
186+
# See https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-STORAGES
185187
STORAGES = {
186188
"default": {
187189
"BACKEND": "django.core.files.storage.FileSystemStorage",
188190
},
191+
# ManifestStaticFilesStorage is recommended in production, to prevent
192+
# outdated JavaScript / CSS assets being served from cache
193+
# (e.g. after a Wagtail upgrade).
194+
# See https://docs.djangoproject.com/en/stable/ref/contrib/staticfiles/#manifeststaticfilesstorage
189195
"staticfiles": {
190-
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
196+
"BACKEND": "django.contrib.staticfiles.storage.ManifestStaticFilesStorage",
191197
},
192198
}
193199

0 commit comments

Comments
 (0)