Announcing WhiteNoise 6
WhiteNoise is a simple solution to serving static assets. It lets you skip configuring a separate web server for your static assets, and serve them straight from Django. It’s a brilliant tool. I’ve used it for years on various projects, and I’ve recommended it many times, and mentioned it in several blog posts.
WhiteNoise was created by Dave Evans in 2013. I’ve met Dave several times at the London Django Meetup. Recently the project’s maintenance was getting a bit backlogged, so I volunteered to help and Dave accepted :)
I got to work adding support for modern Python and Django versions, dropping old ones, and merging in a few feature requests. I just released these accumulated changes as version 6.0.0.
Nothing drastic has changed for the major version bump - most users should not be affected. setuptools’s
python_requires field also ensures users on outdated Python versions still install older WhiteNoise versions. But there are enough changes that it felt like a major number was needed, and version numbers are cheap.
Here are the changelog entries for 6.0.0:
Drop support for Python 3.5 and 3.6.
Add support for Python 3.9 and 3.10.
Drop support for Django 1.11, 2.0, and 2.1.
Add support for Django 4.0.
Import new MIME types from Nginx, changes:
.aviffiles are now served with the
- Open Document files with extensions
.odtare now served with their respective
whitenoise.__version__attribute has been removed. Use
importlib.metadata.version()to check the version of Whitenoise if you need to.
Requests using the
Rangeheader can no longer read beyond the end of the requested range.
Thanks to Richard Tibbles in PR #322.
Treat empty and
Accept-Encodingas if the client doesn’t support any encoding.
Thanks to Richard Tibbles in PR #323.
Thanks very much to Richard Tibbles and Paolo Melchiorre for contributions towards this release. And thanks to Dave Evans for creating such a useful package.
There are still some open issues and PR’s I hope to look at - including an ASGI adapter. Exciting.
Upgrade and let me know if you have any problems!
If your Django project’s long test runs bore you, I wrote a book that can help.
One summary email a week, no spam, I pinky promise.