skillfed

whitenoise

Radically simplified static file serving for WSGI applications

whitenoise v6.12.0 16.7M downloads/30d#1,143 on PyPI2,758
Permissive license MIT Active released

What it is and what it does

WhiteNoise is a WSGI middleware that allows Python web applications to serve their own static files without relying on external services like nginx or Amazon S3. It wraps any WSGI-compatible application and intercepts requests for static assets, handling them efficiently within the application itself. This makes deployments simpler and more self-contained, particularly valuable on Platform-as-a-Service providers where external services may be unavailable or costly.

The package automates several static-file best practices: it compresses responses using gzip and Brotli formats with proper Accept-Encoding and Vary header handling, sets far-future cache headers on immutable content, and includes special auto-configuration for Django applications. It is designed to work alongside CDNs for high-traffic sites, so adopting it does not sacrifice performance for simplicity.

Use it for:

  • Deploy a Django app to Heroku or OpenShift without configuring external static file storage.
  • Serve CSS, JavaScript, and images from a containerized Python application without nginx.
  • Simplify local development by eliminating separate static file server setup.
  • Reduce deployment complexity for small-to-medium traffic sites by bundling static serving.
  • Enable gzip and Brotli compression of static assets with automatic header management.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

WhiteNoise serves static files directly from a Python WSGI application without requiring a separate web server or CDN, handling compression, caching headers, and best practices automatically.

Yes. WhiteNoise is production-stable, actively maintained, has zero security vulnerabilities, requires no external dependencies, and solves a common deployment pain point. Install it if you are deploying a WSGI or Django application to a managed platform or containerized environment where you want static files bundled with the app.

Install

whitenoise on PyPI

pip

pip install whitenoise

uv

uv add whitenoise

poetry

poetry add whitenoise

Installing whitenoise

Before you install

Low install friction with no runtime dependencies. Actively maintained as of 2026-02-27 with recent commits, and marked Production/Stable.

License in practice

MIT license permits commercial and private use with minimal restrictions—straightforward permissive terms suitable for most projects.

Quickstart

pip install whitenoise==6.12.0

from whitenoise import WhiteNoise

app = WhiteNoise(application, root='staticfiles')

Requires Python 3.10 or later; application must be WSGI-compatible.

Verify before relying

  • Performance comparison with dedicated static file servers under high traffic loads.
  • Specific CDN integration patterns and recommended configurations.
  • Exact performance characteristics when serving compressed content formats.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 168 days since the last release
Last repo commit
First released
Downloads 16,674,728/month — #1,143 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: whitenoise-6.12.0-py3-none-any.whl

Keywords: Django

Development Status :: 5 - Production/StableFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTopic :: Internet :: WWW/HTTP :: WSGI :: MiddlewareTyping :: Typed

Tags

static file serving python wsgidjango static files middlewareself-contained web app deploymentgzip brotli compression wsgiheroku paas static filespython web app static assetswsgi static file middleware
wsgi-middlewarestatic-filesdeployment-simplification

More Middleware packages