WSGI middleware for easy serving of static files, with optional integration with Django. Secure and efficient enough to use in production, and designed to be CDN-friendly for high-traffic sites.
Just wrap your WSGI application in the WhiteNoise middleware, give it the path to your static files directory and any requests matching files in that directory will be served correctly. All other requests are passed on to your application.
Features
Simple to configure
Handles caching (sends cache headers and returns Not Modified responses when appropriate)
Serves gzipped content (handling Accept-Encoding and Vary headers correctly)
Provides hooks for customisation, e.g. sending custom headers for certain files
Can serve static files from arbitrary URLs, not just from a fixed URL prefix, so you can use it to serve files like /favicon.ico or /robots.txt
Django version can automatically gzip your files, create uniquely-named versions of each file and set them to be cached forever – all with one line of config
Documentation
Main documentation site: http://whitenoise.evans.io
Get started with WhiteNoise and Django
Get started with WhiteNoise and any other WSGI application
Shouldn’t I be using a real webserver, or a CDN, or Amazon S3? See Infrequently Asked Questions
Compatibility
WhiteNoise works with any WSGI-compatible application and is tested on Python 2.7, 3.3 and 3.4
DjangoWhiteNoise is tested with Django versions 1.4 — 1.7
Endorsements
WhiteNoise is being used in Warehouse, the in-development replacement for the PyPI package repository.
Some of Django and pip’s core developers have said nice things about it:
@jezdez: “[WhiteNoise] is really awesome and should be the standard for Django + Heroku”
@dstufft: “Whitenoise looks pretty excellent.”
Issues
See the GitHub issue tracker.
License
MIT Licensed
Metadata
Release files for whitenoise 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| whitenoise-1.0.tar.gz | 346.0 kB | Without provenance | Details for whitenoise-1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| whitenoise-1.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for whitenoise-1.0-py2.py3-none-any.whl |
Total release size: 358.1 kB
Release files / whitenoise-1.0.tar.gz
| Download URL | whitenoise-1.0.tar.gz |
|---|---|
| Size | 346.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
93712c41b093c891595a228e45c452a9a058ae3e2cc48c2af0647d12114f3e39
|
|
BLAKE2b-256 checksum How to use checksums |
a7d1de840552e8c825f0711c74aac5ce4a52424c612566cdacdb285709f30ab4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / whitenoise-1.0-py2.py3-none-any.whl
| Download URL | whitenoise-1.0-py2.py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
276abc36d499294e46ef809c80e4b9f620e918f43de4475f81304ba37707fc76
|
|
BLAKE2b-256 checksum How to use checksums |
31008545f9ddd30acddb5041f72501e1538e102eae6de20fb5061f54e7edcffb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for whitenoise 1.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.