Middleware that compresses response using brotli algorithm.
Project description
Django Brotli: Middleware that compresses response using brotli algorithm
- PyPI: https://pypi.org/project/django-brotli/
- License: MIT
Introduction
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.
Installation
- Supported Python versions are:
">=3.10, <3.15". - Supported Django versions are:
>=4,<7.
poetry add django-brotli@latest
or
pip install --upgrade django-brotli
Add django_brotli.middleware.BrotliMiddleware to MIDDLEWARE:
MIDDLEWARE = [
'django_brotli.middleware.BrotliMiddleware',
# ...
]
Credits and Resources
Contributing
- 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 :)
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_brotli-0.4.0.tar.gz.
File metadata
- Download URL: django_brotli-0.4.0.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c445660049edfc159382899cb84598c406cb693877d3ab82669304105155b52
|
|
| MD5 |
8166afd9bfa6a9ba1e7eed0aac499997
|
|
| BLAKE2b-256 |
251f797b163de39783744c5ab25a03e423342ef298f19d2cb0d24409be31aa9a
|
File details
Details for the file django_brotli-0.4.0-py3-none-any.whl.
File metadata
- Download URL: django_brotli-0.4.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f8cdfc9de0948891e513258e3e918328b31a3d2509a59445d42a01fa4c308a3
|
|
| MD5 |
321a76c034fddc2f3a858dea1c3af211
|
|
| BLAKE2b-256 |
38d5cce277130e9ea39ff0386f95daca507427c12a33b608cc94d2958b06d3b2
|