Merge pull request #431 from arachnys/whitenoise

Add whitenoise for serving static files
This commit is contained in:
Frank Hamand 2017-02-17 14:46:26 +00:00 committed by GitHub
commit 764a93e4ca
3 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,8 @@
master
------
* Use whitenoise to serve static files
Version 0.8.3
-------------

View File

@ -81,6 +81,9 @@ COMPRESS_URL = STATIC_URL
# Additional locations of static files
STATICFILES_DIRS = [os.path.join(PROJECT_ROOT, 'static')]
if not DEBUG:
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
@ -111,6 +114,7 @@ TEMPLATES = [{
}]
MIDDLEWARE_CLASSES = (
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
@ -120,7 +124,6 @@ MIDDLEWARE_CLASSES = (
)
ROOT_URLCONF = 'cabot.urls'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',

View File

@ -29,3 +29,4 @@ twilio==3.4.1
wsgiref==0.1.2
python-dateutil==2.1
django-auth-ldap==1.2.6
whitenoise==3.3.0