Skip to main content

Django Brotli: Middleware that compresses response using brotli algorithm

License: MIT pypi pypi Python version Supported Django
Build Status codecov

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

  1. Clone this repository (git clone ...)
  2. Install package dependencies: poetry install --with dev -v
  3. Change some code
  4. Run tests: in project root simply execute pytest
  5. Submit PR :)

License

The MIT License (MIT)

Metadata

Release files for django-brotli 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-brotli 0.4.0
File Size Uploaded Provenance
django_brotli-0.4.0.tar.gz 6.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-brotli 0.4.0
File Interpreter ABI Platform
django_brotli-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.9 kB

Release files / django_brotli-0.4.0.tar.gz

Download URL django_brotli-0.4.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5c445660049edfc159382899cb84598c406cb693877d3ab82669304105155b52
BLAKE2b-256 checksum
How to use checksums
251f797b163de39783744c5ab25a03e423342ef298f19d2cb0d24409be31aa9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / django_brotli-0.4.0-py3-none-any.whl

Download URL django_brotli-0.4.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f8cdfc9de0948891e513258e3e918328b31a3d2509a59445d42a01fa4c308a3
BLAKE2b-256 checksum
How to use checksums
38d5cce277130e9ea39ff0386f95daca507427c12a33b608cc94d2958b06d3b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for django-brotli 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page