feat: serve static files with whitenoise
This commit is contained in:
1 file changed
+6
@@ -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 = {
|
||||
|
||||
Reference in new issue
Block a user