[patch] view for serving static files
|Reported by:||volsung@…||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)
Changed 10 years ago by volsung@…
Changed 10 years ago by Stan Seibert <volsung@…>
comment:1 Changed 10 years ago by Stan Seibert <volsung@…>
- Summary changed from view for serving static files to [patch] view for serving static files
comment:3 Changed 10 years ago by volsung@…
- priority changed from low to normal
- Severity changed from minor to normal