Am building an app using Django as my workhorse. All has been well so far - specified db settings, configured static directories, urls, views etc. But trouble started sneaki
You actually can serve static files in a production Django app, securely and without DEBUG=True
.
Rather than using Django itself, use dj_static in your WSGI file (github):
# requirements.txt:
...
dj-static==0.0.6
# YOURAPP/settings.py:
...
STATIC_ROOT = 'staticdir'
STATIC_URL = '/staticpath/'
# YOURAPP/wsgi.py:
...
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
application = Cling(get_wsgi_application())