From 366ef352c60fc4d328f7b25090b968f1ee42b699 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 11 Apr 2019 13:43:08 +0200 Subject: [PATCH] switch to whitenoise for static files --- passbook/core/requirements.txt | 1 + passbook/core/settings.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/passbook/core/requirements.txt b/passbook/core/requirements.txt index fd80ba3f1..5d7793425 100644 --- a/passbook/core/requirements.txt +++ b/passbook/core/requirements.txt @@ -12,3 +12,4 @@ psycopg2 PyYAML sentry-sdk pip +whitenoise diff --git a/passbook/core/settings.py b/passbook/core/settings.py index 421d9c122..47dda43c3 100644 --- a/passbook/core/settings.py +++ b/passbook/core/settings.py @@ -121,6 +121,7 @@ CACHES = { MIDDLEWARE = [ 'django.contrib.sessions.middleware.SessionMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'passbook.app_gw.middleware.ApplicationGatewayMiddleware', 'django.middleware.security.SecurityMiddleware', @@ -246,6 +247,7 @@ with CONFIG.cd('web'): # https://docs.djangoproject.com/en/2.1/howto/static-files/ STATIC_URL = '/static/' +STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' LOG_HANDLERS = ['console', 'syslog', 'file']