### Installation Source: https://whitenoise.readthedocs.io Install WhiteNoise using pip. ```bash pip install whitenoise ``` -------------------------------- ### Other WSGI Apps QuickStart Source: https://whitenoise.readthedocs.io Wrap your WSGI application with WhiteNoise and specify static file directories. ```python from whitenoise import WhiteNoise from my_project import MyWSGIApp application = MyWSGIApp() application = WhiteNoise(application, root="/path/to/static/files") application.add_files("/path/to/more/static/files", prefix="more-files/") ``` -------------------------------- ### Django QuickStart - Middleware Source: https://whitenoise.readthedocs.io Add WhiteNoise to the MIDDLEWARE list in Django's settings.py. ```python MIDDLEWARE = [ # ... "django.middleware.security.SecurityMiddleware", "whitenoise.middleware.WhiteNoiseMiddleware", # ... ] ``` -------------------------------- ### Django QuickStart - Storage Source: https://whitenoise.readthedocs.io Configure WhiteNoise's storage backend for compressed and cacheable files. ```python STORAGES = { # ... "staticfiles": { "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage", }, } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.