From a81d2455e5cac98932a3ac1d7cab545b4c59c2ac Mon Sep 17 00:00:00 2001 From: Moggach Date: Mon, 12 Feb 2024 13:20:18 +0000 Subject: [PATCH] install whitenoise to deal with static files on render --- app/settings/base.py | 7 ++----- app/settings/production.py | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/settings/base.py b/app/settings/base.py index db2efe5..a5ea1b4 100644 --- a/app/settings/base.py +++ b/app/settings/base.py @@ -84,12 +84,9 @@ "django.middleware.security.SecurityMiddleware", ] -if USE_WHITENOISE: - MIDDLEWARE += [ - "whitenoise.middleware.WhiteNoiseMiddleware", - ] - MIDDLEWARE += [ + 'django.middleware.security.SecurityMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", diff --git a/app/settings/production.py b/app/settings/production.py index 1148246..eda677c 100644 --- a/app/settings/production.py +++ b/app/settings/production.py @@ -2,8 +2,8 @@ from .base import * -if USE_WHITENOISE: - STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" +STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" + DEBUG = False SECRET_KEY = os.getenv("SECRET_KEY")