mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
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:
parent
c32fc79aa1
commit
6c730da1f6
22 changed files with 340 additions and 481 deletions
|
@ -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()
|
||||
-----
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue