- 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.15". - Supported Django versions are:
>=4,<7.
poetry add django-brotli@latestor
pip install --upgrade django-brotliAdd 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 :)