Problem: Static resources (images, js, css, etc.) lead to
Potential fix: A similar question was posted here and here. This is actually by design, as django is not meant to server static resources when
Basically, when you’re in
DEBUG mode, static files are being served via the staticfiles app (which uses settings like
STATICFILES_FINDERS to properly locate your static resources). When DEBUG=FALSE, the staticfiles app doesn’t run and your static resources aren’t being referenced correctly by the django webserver. However, if you were to host the files are an actual webserver, the
STATIC_URL settings should hold up.
There is a way to force the staticfiles app to run in
DEBUG=FALSE mode though, which can be useful when you want to test a deployment locally with django. You just have to add an
--insecure flag when you run the django webserver:
django-admin.py runserver --insecure
As noted here, the
--insecure option should only be used for testing purposes.