Hash static filenames in production via ManifestStaticFilesStorage.

Enables cache-busted asset URLs after collectstatic when DEBUG is disabled.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Pirmin Hinderling (fedora)
2026-07-07 21:45:23 +02:00
parent 417e1036be
commit fce11689e1
+13
View File
@@ -143,6 +143,19 @@ STATIC_URL = 'static/'
STATICFILES_DIRS = [BASE_DIR / 'static'] STATICFILES_DIRS = [BASE_DIR / 'static']
STATIC_ROOT = BASE_DIR / 'staticfiles' STATIC_ROOT = BASE_DIR / 'staticfiles'
STORAGES = {
'default': {
'BACKEND': 'django.core.files.storage.FileSystemStorage',
},
'staticfiles': {
'BACKEND': (
'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
if not DEBUG
else 'django.contrib.staticfiles.storage.StaticFilesStorage'
),
},
}
MEDIA_URL = 'media/' MEDIA_URL = 'media/'
MEDIA_ROOT = BASE_DIR / 'media' MEDIA_ROOT = BASE_DIR / 'media'