Commit 484409ca by Ed Morley

Update WhiteNoise from 2.0.6 to 3.2

WhiteNoise 3.0 switched to a new middleware based integration approach:
http://whitenoise.evans.io/en/stable/changelog.html#v3-0

This means WhiteNoise now plays nicely with other middleware classes
such as `SecurityMiddleware`, allowing for HTTPS redirection for
WhiteNoise-served assets too.

Full documentation is here:
http://whitenoise.evans.io/en/stable/django.html#enable-whitenoise
parent 990573f5
......@@ -39,6 +39,7 @@ INSTALLED_APPS = [
MIDDLEWARE_CLASSES = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
......@@ -127,4 +128,4 @@ STATICFILES_DIRS = [
# Simplified static file serving.
# https://warehouse.python.org/project/whitenoise/
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
......@@ -9,11 +9,8 @@ https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
import os
# Must be defined prior to importing `whitenoise.django`.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
application = get_wsgi_application()
application = DjangoWhiteNoise(application)
\ No newline at end of file
......@@ -2,4 +2,4 @@ dj-database-url==0.4.0
Django==1.9.2
gunicorn==19.4.5
psycopg2==2.6.1
whitenoise==2.0.6
whitenoise==3.2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment