This is a simple Django middleware utility that allows you to properly serve static assets from production with a WSGI server like Gunicorn.
Django doesn’t recommend the production use of its static file server for a number of reasons. There exists, however, a lovely WSGI application aptly named Static.
It is suitable for the production use of static file serving, unlike Django.
Usage
Configure your static assets in settings.py:
STATIC_ROOT = 'staticfiles' STATIC_URL = '/static/'
Then, update your wsgi.py file to use dj-static:
from django.core.wsgi import get_wsgi_application from dj_static import Cling application = Cling(get_wsgi_application())
Metadata
Release files for dj-static 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dj-static-0.0.6.tar.gz | 3.4 kB | Details |
Release files / dj-static-0.0.6.tar.gz
| Download URL | dj-static-0.0.6.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
032ec1c532617922e6e3e956d504a6fb1acce4fc1c7c94612d0fda21828ce8ef
|
|
BLAKE2b-256 checksum How to use checksums |
2b8f77a4b8ec50c821193bf9682c7896f12fd0418eb3711a7d66796ede59c23b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |