Opened 18 years ago
Closed 18 years ago
#2963 closed defect (fixed)
"How to serve static files" doc contains invalid example
Reported by: | Owned by: | Jacob | |
---|---|---|---|
Component: | Documentation | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
On http://www.djangoproject.com/documentation/static_files/ it shows the usage of django.views.static.serve as:
(r'^site_media/(.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'}),
But this is invalid. It should be:
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'}),
The directory index example has the same problem:
(r'^site_media/(.*)$', 'django.views.static.serve', {'document_root': '/path/to/media', 'show_indexes': True}),
should be:
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/path/to/media', 'show_indexes': True}),
Note:
See TracTickets
for help on using tickets.
(In [3952]) Fixed #2963 -- Fixed bug in docs/static_files.txt. Thanks, Collin Grady