Serving Static Files with WhiteNoise

A snippet showing how to integrate WhiteNoise for static files.


# settings.py
MIDDLEWARE = [
    "django.middleware.security.SecurityMiddleware",
    "whitenoise.middleware.WhiteNoiseMiddleware",
    # ...
]

STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
      
Explanation:
  • WhiteNoise allows Django to serve compressed static files in production.
  • Category Static & Media Files
  • Total Views 951
  • Last Modified 20 April, 2026
  • Tags #static #whitenoise #deployment #files
Never miss a story on Django.wiki

Subscribe for fresh tutorials, snippets, and updates.

By subscribing you agree to our Privacy Policy.