I’m using the staticfiles app during development, which doesn’t work unless DEBUG is turned on.
From the docs:
Warning This will only work if DEBUG is True.
That’s because this view is grossly inefficient and probably insecure.
This is only intended for local development, and should never be used
in production.Additionally, when using staticfiles_urlpatterns your STATIC_URL
setting can’t be empty or a full URL, such as
http://static.example.com/.
I’m trying to view my Http404 templates, though, and of course they don’t work in DEBUG mode. So I’m in a catch 22 – if I want to view the 404 page I have to turn off DEBUG, but then no static files are servers and I can’t see any images, etc.
You can simply pretend you are in production. Run:
To have all your files copied to
STATIC_ROOT. Then, temporarily add the following to urls.py:You’ll have to run
collectstaticeach time you make a change to any static files, so I would suggest live-editing in something like Firebug and then saving the finished product. Also, remember to delete thestaticdirectory and remove that line from urls.py when you’re done.