Skip to content

Commit

Permalink
Add option to serve files with WhiteNoise. Fix #2938.
Browse files Browse the repository at this point in the history
  • Loading branch information
glogiotatidis authored and pmac committed Nov 27, 2017
1 parent 3056161 commit a99ce13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions requirements/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -413,3 +413,6 @@ greenlet==0.4.12 \
--hash=sha256:9c407aa6adfd4eea1232e81aa9f3cb3d9b955a9891c4819bf9b498c77efba14b \
--hash=sha256:b56ac981f07b77e72ad5154278b93396d706572ea52c2fce79fee2abfcc8bfa6 \
--hash=sha256:e4c99c6010a5d153d481fdaf63b8a0782825c0721506d880403a3b9b82ae347e
whitenoise==4.0b4 \
--hash=sha256:9a8ef48d2a2b4a101d84a0e5edbb20759affbc832cd74f3194e803cca7f28f6a \
--hash=sha256:c42d640b8db482924b36ddadcc7087cf49f796fa1faa1583b3d07118f55a4265
4 changes: 4 additions & 0 deletions wsgi/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
application = get_wsgi_application()
application = Sentry(application)

if config('ENABLE_WHITENOISE', default=False, cast=bool):
from whitenoise.django import DjangoWhiteNoise
application = DjangoWhiteNoise(application)

# Add NewRelic
newrelic_ini = config('NEW_RELIC_CONFIG_FILE', default='newrelic.ini')
newrelic_license_key = config('NEW_RELIC_LICENSE_KEY', default=None)
Expand Down

0 comments on commit a99ce13

Please sign in to comment.