Skip to content

Commit

Permalink
serving static files by whitenoise
Browse files Browse the repository at this point in the history
  • Loading branch information
ira committed Dec 3, 2015
1 parent cb908c4 commit 9ec3669
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pycd/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
'testreport',
'cdws_api',
'stages',
'metrics',
'metrics'
)

MIDDLEWARE_CLASSES = (
Expand Down Expand Up @@ -208,3 +208,4 @@
STATIC_URL = os.environ.get('STATIC_URL', '/static/')
STATIC_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)),
os.environ.get('STATIC_ROOT', 'static'))
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
3 changes: 3 additions & 0 deletions pycd/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pycd.settings")

from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise

application = get_wsgi_application()
application = DjangoWhiteNoise(application)
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ pytz
psutil==3.2.2
defusedxml==0.4.1
djangorestframework-xml==1.2.0
whitenoise==2.0.6

0 comments on commit 9ec3669

Please sign in to comment.