[patch] view for serving static files
|Reported by:||Owned by:||Jacob|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
It would be nice to be able to serve static files from disk while using the test django server. This can be done with a view and urlpattern.
I've hacked up an implementation at: http://django.pastebin.com/347411
To use it, put that in your view directory (say in static.py), then add
DOCUMENT_ROOT = '/your/local/document/root/dir'
to your settings file, and a pattern:
at the end of your urlpatterns list. This will pick up all the URLs that all the previous patterns couldn't match and try to find them under DOCUMENT_ROOT.
Is there any interest in adding this view to the other views django already provides?
Change History (7)
comment:1 Changed 11 years ago by
|Summary:||view for serving static files → [patch] view for serving static files|