Skip to content

Commit 8461ec8

Browse files
committed
Update whitenoise to 4.1
1 parent 95c111e commit 8461ec8

3 files changed

Lines changed: 5 additions & 12 deletions

File tree

‎locallibrary/settings.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
MIDDLEWARE = [
4848
'django.middleware.security.SecurityMiddleware',
49+
'whitenoise.middleware.WhiteNoiseMiddleware',
4950
'django.contrib.sessions.middleware.SessionMiddleware',
5051
'django.middleware.common.CommonMiddleware',
5152
'django.middleware.csrf.CsrfViewMiddleware',
@@ -143,6 +144,6 @@
143144
STATIC_URL = '/static/'
144145

145146

146-
# Simplified static file serving.
147-
# https://warehouse.python.org/project/whitenoise/
148-
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
147+
# Static file serving.
148+
# http://whitenoise.evans.io/en/stable/django.html#django-middleware
149+
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

‎locallibrary/wsgi.py‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,3 @@
1313
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'locallibrary.settings')
1414

1515
application = get_wsgi_application()
16-
17-
18-
# Add static serving using whitenoise
19-
from django.core.wsgi import get_wsgi_application
20-
from whitenoise.django import DjangoWhiteNoise
21-
22-
application = get_wsgi_application()
23-
application = DjangoWhiteNoise(application)

‎requirements.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ Django==2.0.2
33
gunicorn==19.7.1
44
psycopg2-binary==2.7.6
55
wheel==0.30.0
6-
whitenoise==3.3.1
6+
whitenoise==4.1

0 commit comments

Comments
 (0)