Production-grade static file server for Python WSGI & ASGI applications, with support for Django, compression, and content hashing. Current version: 4.3.0, released April 2025. Active development.
pip install servestaticNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Wrap any WSGI app with ServeStatic to serve static files.
Set immutable_file_test explicitly if you rely on old behavior, e.g., ServeStatic(app, immutable_file_test=r'').
Pass allow_unsafe_symlinks=True to ServeStatic or set SERVESTATIC_ALLOW_UNSAFE_SYMLINKS=True in Django settings.
Run `servestatic --compress` after installing with [cli] extras.
Set SERVESTATIC_USE_STATIC_ROOT = True in settings.py if you want ServeStatic to scan STATIC_ROOT at startup.
Run `pip install servestatic` in the correct Python environment.
Use `from servestatic.wsgi import ServeStatic` or `from servestatic.asgi import ServeStaticASGI` for ASGI.
Wrap your existing WSGI app: `app.wsgi_app = ServeStatic(app.wsgi_app, root='...')`.
Add 'servestatic' to INSTALLED_APPS in Django settings.