Hey @limedaring.
Your book is much appreciated and I enjoyed the first 14 chapters until I tried to deploy to Heroku. I spent a painful 60 minutes trying to understand which part in the book I got wrong, but eventually I figured out that the problem is outdated code. WhiteNoise does not work like you describe it in the book anymore.
A reader that follows the book closely will get this error when pushing to Heroku:
ImportError:
remote: Your WhiteNoise configuration is incompatible with WhiteNoise v4.0
remote: This can be fixed by following the upgrade instructions at:
remote: http://whitenoise.evans.io/en/stable/changelog.html#v4-0
The changes a reader needs to make:
- remove any mention of WhiteNoise in the wsgi.py file
- add “‘whitenoise.middleware.WhiteNoiseMiddleware’,” right below “‘django.middleware.security.SecurityMiddleware’,” in the Middleware section in settings.py
- replace “STATICFILES_STORAGE = ‘whitenoise.django.GzipManifestStaticFilesStorage’” with “STATICFILES_STORAGE = ‘whitenoise.storage.CompressedManifestStaticFilesStorage’” in settings_production.py
See here for more info on how to fix it: http://whitenoise.evans.io/en/stable/changelog.html#v4-0