Middleware that compresses response using brotli algorithm.
Project description
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
This software is in alpha version and should not be used in production.
Supported Python versions are: 3.5, 3.6 and 3.7.
Supported Django versions are: 1.11.x (LTS), 2.0.x and 2.1.x (LTS).
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 ...)
Create virtualenv
Install package dependencies: pip install --upgrade -r requirements.txt
Change some code
Run tests: in project root simply execute pytest
Submit PR :)
License
The MIT License (MIT)
Copyright (c) 2016–2019 Vašek Dohnal (@illagrenan)
Project details
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
File details
Details for the file django-brotli-0.2.1.tar.gz
.
File metadata
- Download URL: django-brotli-0.2.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e99d774ddb48aabdb1d209d601a46226260f0030a59e551a0a0d39f8e79f6aa |
|
MD5 | e43e6f25ce4d6dde45b90ea182e7ea56 |
|
BLAKE2b-256 | ed0ba4193a29fd97a5c023f605e42f16272bd27fcaa3f7e471f405b5f6dfffd0 |
File details
Details for the file django_brotli-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: django_brotli-0.2.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f990fabc14ca2b1f18e741014df4f35a845a6fef0c493454db5f62faba8d276 |
|
MD5 | 38b9eb745fc3310e95de780b8f086f88 |
|
BLAKE2b-256 | b3e9d83377ee79d63112b074fb3da5d394001848ef0ca4b24c7eea37b3457d82 |