#4792 closed (invalid)
Serving Static Files Documentation
| Reported by: | Owned by: | Jacob | |
|---|---|---|---|
| Component: | Documentation | Version: | dev |
| Severity: | Keywords: | static files | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The serving static files documentation here doesn't mention that the pattern to be added to Urlconf has to be placed as the first pattern.
Examples:
#Won't work:
urlpatterns = patterns('',
(r'^/articles/2003/$', 'news.views.special_case_2003'),
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'}),
)
#Will work:
urlpatterns = patterns('',
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'}),
(r'^/articles/2003/$', 'news.views.special_case_2003'),
)
Change History (2)
follow-up: 2 comment:1 by , 18 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
comment:2 by , 18 years ago
Replying to Paul Bx:
It doesn't have to be first. I'm guessing you have a hungry URL pattern somewhere before it (in your actual URLconf, not this made-up example one). Ask for help on the IRC channel or the django-users list and ye shall receive.
You're right, the problem was exactly as you described. Sorry for submitting the unnecessary ticket.
Note:
See TracTickets
for help on using tickets.
It doesn't have to be first. I'm guessing you have a hungry URL pattern somewhere before it (in your actual URLconf, not this made-up example one). Ask for help on the IRC channel or the django-users list and ye shall receive.