- PyPI: https://pypi.org/project/django-brotli/
- License: MIT
This project consists of BrotliMiddleware
which works the same as Django GZipMiddleware
(Docs/Source). BrotliMiddleware
will compress content of HTTP response using brotli algorithm (Brotli Compressed Data Format is defined in RFC 7932).
In November 2016 is brotli supported by Firefox, Chrome, Android Browser and Opera (detailed stats on caniuse). Brotli is applied only when client has sent Accept-Encoding
header containing br
.
- Supported Python versions are:
">=3.10, <3.14"
. - Supported Django versions are:
>=4,<6
.
poetry add django-brotli@latest
or
pip install --upgrade django-brotli
Add django_brotli.middleware.BrotliMiddleware
to MIDDLEWARE
:
MIDDLEWARE = [
'django_brotli.middleware.BrotliMiddleware',
# ...
]
- Clone this repository (
git clone ...
) - Install package dependencies:
poetry install --with dev -v
- Change some code
- Run tests: in project root simply execute
pytest
- Submit PR :)