Fixed #19897 - Updated static files howto.

Thanks Jan Murre, Reinout van Rees and Wim Feijen,
plus Remco Wendt for reviewing.
This commit is contained in:
Tim Graham 2013-03-07 14:15:39 -05:00
parent c32fc79aa1
commit 6c730da1f6
22 changed files with 340 additions and 481 deletions

View file

@ -44,6 +44,20 @@ The ``optional_dictionary`` and ``optional_name`` parameters are described in
patterns you can construct. The only limit is that you can only create 254
at a time (the 255th argument is the initial prefix argument).
static()
--------
.. function:: static.static(prefix, view='django.views.static.serve', **kwargs)
Helper function to return a URL pattern for serving files in debug mode::
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = patterns('',
# ... the rest of your URLconf goes here ...
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
url()
-----