From fce11689e1d9b31cd1963b1c82d04d5b2c86ca31 Mon Sep 17 00:00:00 2001 From: "Pirmin Hinderling (fedora)" Date: Tue, 7 Jul 2026 21:45:23 +0200 Subject: [PATCH] Hash static filenames in production via ManifestStaticFilesStorage. Enables cache-busted asset URLs after collectstatic when DEBUG is disabled. Co-authored-by: Cursor --- faktenkompass/settings.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/faktenkompass/settings.py b/faktenkompass/settings.py index 9f6c727..845f6a9 100644 --- a/faktenkompass/settings.py +++ b/faktenkompass/settings.py @@ -143,6 +143,19 @@ STATIC_URL = 'static/' STATICFILES_DIRS = [BASE_DIR / 'static'] 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_ROOT = BASE_DIR / 'media'