diff --git a/app/app/settings.py b/app/app/settings.py index c1286f3c..d1252a32 100644 --- a/app/app/settings.py +++ b/app/app/settings.py @@ -40,6 +40,7 @@ if os.environ.get('DEBUG') == 'False': # Application definition INSTALLED_APPS = [ + 'whitenoise.runserver_nostatic', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', @@ -55,6 +56,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 +90,8 @@ STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'server/static'), ] +STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' + WSGI_APPLICATION = 'app.wsgi.application' AUTHENTICATION_BACKENDS = [ diff --git a/requirements.txt b/requirements.txt index e931cc8f..f532c1c2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,4 +17,4 @@ social-auth-app-django==3.1.0 social-auth-core[azuread]==3.0.0 text-unidecode==1.2 tornado==5.0.2 -whitenoise==3.3.1 +whitenoise[brotli]==4.1.2