From 1d4a509c7e906b52c0259b92785c1994f2241fd1 Mon Sep 17 00:00:00 2001 From: Aarni Halinen Date: Tue, 8 Oct 2019 09:34:56 +0300 Subject: [PATCH] Install whitenoise for serving static files --- Pipfile | 1 + Pipfile.lock | 10 +++++++++- requirements.txt | 1 + sikweb/base.py | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index 31a4767..cbcef23 100644 --- a/Pipfile +++ b/Pipfile @@ -47,6 +47,7 @@ Django = "==2.1.5" ipython_genutils = "==0.1.0" Pillow = "==5.4.1" PyJWT = "==1.6.4" +whitenoise = "==4.1.4" [requires] python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock index 6176e90..7d31616 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "85a50ecbb054f863d8a149def7c32f916b9cd326aee80c2c86eda2b44ee20e2d" + "sha256": "aaefeb42f8fc73a67edd3c9b61176e4735f8daf1393b2685ad8b5274f5199b0d" }, "pipfile-spec": 6, "requires": { @@ -644,6 +644,14 @@ ], "version": "==1.25.6" }, + "whitenoise": { + "hashes": [ + "sha256:22f79cf8f1f509639330f93886acaece8ec5ac5e9600c3b981d33c34e8a42dfd", + "sha256:6dfea214b7c12efd689007abf9afa87a426586e9dbc051873ad2c8e535e2a1ac" + ], + "index": "pypi", + "version": "==4.1.4" + }, "xlrd": { "hashes": [ "sha256:546eb36cee8db40c3eaa46c351e67ffee6eeb5fa2650b71bc4c758a29a1b29b2", diff --git a/requirements.txt b/requirements.txt index 5e1bc61..3261db1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -37,3 +37,4 @@ django-import-export==0.7.0 openpyxl==2.4.11 django-app-namespace-template-loader==0.4.1 django-filter==2.0.0 +whitenoise==4.1.4 diff --git a/sikweb/base.py b/sikweb/base.py index ba33914..7c026d7 100644 --- a/sikweb/base.py +++ b/sikweb/base.py @@ -123,6 +123,7 @@ NOSE_ARGS = [ MIDDLEWARE = [ 'sikweb.middleware.ForceDefaultLanguageMiddleware', 'django.middleware.security.SecurityMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'corsheaders.middleware.CorsMiddleware',