Whitenoise

Latest version: v6.8.2

Safety actively analyzes 688619 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 8

3.2.3

Not secure
------------------

* Gracefully handle invalid byte sequences in URLs.

* Gracefully handle filenames which are too long for the filesystem.

* Send correct Content-Type for Adobe's ``crossdomain.xml`` files.

3.2.2

Not secure
------------------

* Convert any config values supplied as byte strings to text to avoid runtime encoding errors when encountering non-ASCII filenames.

3.2.1

Not secure
------------------

* Handle non-ASCII URLs correctly when using the ``wsgi.py`` integration.

* Fix exception triggered when a static files "finder" returned a directory rather than a file.

3.2

Not secure
----------------

* Add support for the new-style middleware classes introduced in Django 1.10.
The same WhiteNoiseMiddleware class can now be used in either the old
``MIDDLEWARE_CLASSES`` list or the new ``MIDDLEWARE`` list.

* Fixed a bug where incorrect Content-Type headers were being sent on 304 Not
Modified responses (thanks `oppianmatt <https://github.com/oppianmatt>`_).

* Return Vary and Cache-Control headers on 304 responses, as specified by the
`RFC <https://tools.ietf.org/html/rfc7232#section-4.1>`_.

3.1

Not secure
----------------

* Add new :any:`WHITENOISE_STATIC_PREFIX` setting to give flexibility in
supporting non-standard deployment configurations e.g. serving the
application somewhere other than the domain root.

* Fix bytes/unicode bug when running with Django 1.10 on Python 2.7

3.0

Not secure
----------------

.. note:: The latest version of WhiteNoise contains some small **breaking changes**.
Most users will be able to upgrade without any problems, but some
less-used APIs have been modified:

* The setting ``WHITENOISE_GZIP_EXCLUDE_EXTENSIONS`` has been renamed to
``WHITENOISE_SKIP_COMPRESS_EXTENSIONS``.

* The CLI :ref:`compression utility <cli-utility>` has moved from ``python -m whitenoise.gzip``
to ``python -m whitenoise.compress``.

* The now redundant ``gzipstatic`` management command has been removed.

* WhiteNoise no longer uses the system mimetypes files, so if you are serving
particularly obscure filetypes you may need to add their mimetypes explicitly
using the new :any:`mimetypes <WHITENOISE_MIMETYPES>` setting.

* Older versions of Django (1.4-1.7) and Python (2.6) are no longer supported.
If you need support for these platforms you can continue to use `WhiteNoise
2.x`_.

* The ``whitenoise.django.GzipManifestStaticFilesStorage`` storage backend
has been moved to
``whitenoise.storage.CompressedManifestStaticFilesStorage``. The old
import path **will continue to work** for now, but users are encouraged
to update their code to use the new path.

.. _WhiteNoise 2.x: https://whitenoise.readthedocs.io/en/legacy-2.x/

.. rubric:: Simpler, cleaner Django middleware integration

WhiteNoise can now integrate with Django by adding a single line to
``MIDDLEWARE_CLASSES`` without any need to edit ``wsgi.py``. This also means
that WhiteNoise plays nicely with other middleware classes such as
*SecurityMiddleware*, and that it is fully compatible with the new `Channels`_
system. See the :ref:`updated documentation <django-middleware>` for details.

.. _Channels: https://channels.readthedocs.io/

.. rubric:: Brotli compression support

`Brotli`_ is the modern, more efficient alternative to gzip for HTTP
compression. To benefit from smaller files and faster page loads, just install
the `brotlipy`_ library, update your ``requirements.txt`` and WhiteNoise
will take care of the rest. See the :ref:`documentation <brotli-compression>`
for details.

.. _brotli: https://en.wikipedia.org/wiki/Brotli
.. _brotlipy: https://brotlipy.readthedocs.io/

.. rubric:: Simpler customisation

It's now possible to add custom headers to WhiteNoise without needing to create
a subclass, using the new :any:`add_headers_function
<WHITENOISE_ADD_HEADERS_FUNCTION>` setting.

.. rubric:: Use WhiteNoise in development with Django

There's now an option to force Django to use WhiteNoise in development, rather
than its own static file handling. This results in more consistent behaviour
between development and production environments and fewer opportunities for
bugs and surprises. See the :ref:`documentation <runserver-nostatic>` for
details.

.. rubric:: Improved mimetype handling

WhiteNoise now ships with its own mimetype definitions (based on those shipped
with nginx) instead of relying on the system ones, which can vary between
environments. There is a new :any:`mimetypes <WHITENOISE_MIMETYPES>`
configuration option which makes it easy to add additional type definitions if
needed.

.. rubric:: Thanks

A big thank-you to `Ed Morley <https://github.com/edmorley>`_ and `Tim Graham <https://github.com/timgraham>`_ for their contributions to this release.

Page 5 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.