You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For whitenoise v4.* onwards (released Aug 2018), changelog states:
The WSGI integration option for Django (which involved editing wsgi.py) has been removed. > Instead, you should add WhiteNoise to your middleware list in settings.py and remove any reference to WhiteNoise from wsgi.py. See the documentation for more details.
(The pure WSGI integration is still available for non-Django apps.)
Edit your settings.py file and add WhiteNoise to the MIDDLEWARE list. The WhiteNoise middleware should be placed directly after the Django SecurityMiddleware (if you are using it) and before all other middleware:
That’s it – WhiteNoise will now serve your static files. However, to get the best performance you should proceed to step 3 below and enable compression and caching.
To add automatic compression with the caching behaviour provided by Django’s ManifestStaticFilesStorage backend, add this also to settings.py
Whilst better options are available for handling environmental settings configuration, I understand that using local_settings.py is easy to understand and does the job well enough. However, it's not being applied locally in these instructions: https://tutorial-extensions.djangogirls.org/en/heroku/#mysitelocalsettingspy
To apply these locally, we just need to add following to the bottom of settings.py:
# Override with local_settings if it existstry:
from .local_settingsimport*exceptImportError:
pass
The text was updated successfully, but these errors were encountered:
1. Whitenoise instructions
Currently the tutorial has following guidance to install whitenoise (from https://tutorial-extensions.djangogirls.org/en/heroku/#mysitewsgipy):
For whitenoise v4.* onwards (released Aug 2018), changelog states:
Here's new guidelines (from http://whitenoise.evans.io/en/stable/django.html):
To add automatic compression with the caching behaviour provided by Django’s ManifestStaticFilesStorage backend, add this also to
settings.py
2. local_settings.py
Whilst better options are available for handling environmental settings configuration, I understand that using
local_settings.py
is easy to understand and does the job well enough. However, it's not being applied locally in these instructions: https://tutorial-extensions.djangogirls.org/en/heroku/#mysitelocalsettingspyTo apply these locally, we just need to add following to the bottom of
settings.py
:The text was updated successfully, but these errors were encountered: