From fef4b407709a58369075e5d22e91b013acd9aa04 Mon Sep 17 00:00:00 2001 From: Clemens Wolff Date: Mon, 28 Jan 2019 10:35:43 -0500 Subject: [PATCH] Make it explicit that whitenoise is being used As per http://whitenoise.evans.io/en/stable/django.html#enable-whitenoise, the whitenoise middleware should be added just after the django-security middleware. --- app/app/settings.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/app/settings.py b/app/app/settings.py index c1286f3c..662718bc 100644 --- a/app/app/settings.py +++ b/app/app/settings.py @@ -55,6 +55,7 @@ INSTALLED_APPS = [ MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', @@ -88,6 +89,8 @@ STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'server/static'), ] +STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' + WSGI_APPLICATION = 'app.wsgi.application' AUTHENTICATION_BACKENDS = [