feat: serve static files with whitenoise

This commit is contained in:
ponas committed 2026-11-03 03:52:46 +01:00
1 parent 712f370245
commit 9350064c63
1 file changed
+6
+6
View File
@@ -45,6 +45,7 @@ INSTALLED_APPS += [
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
@@ -99,6 +100,11 @@ STATIC_URL = "/static/"
# Postfix and Dovecot read these tables directly; keep the existing integer id columns.
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
STATIC_ROOT = BASE_DIR / "static"
STORAGES = {
"default": {"BACKEND": "django.core.files.storage.FileSystemStorage"},
"staticfiles": {"BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage"},
}
LOGGING = {