#8897: Peculiarity in url template tag - lookup fails when view name enclosed in
single quotes
----------------------------------+-----------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: nobody
Status: new | Milestone:
Component: Template system | Version: 1.0
Keywords: | Stage: Unreviewed
Has_patch: 0 |
----------------------------------+-----------------------------------------
Does what it says on the tin.
Old, non-working code example:
urls.py
{{{
urlpatterns = patterns('',
url(r'^servicemanagement/status/$',
'nwwcfh.servicestatus.views.map_details', name='map-details'),
}}}
intended template usage:
{{{
<li><a href="{% url map-details %}" title="View an map of current service
status">Service Status</a></li>
}}}
This fails, giving one of two errors (seemingly at random): either "there
is no module named urls" or a message complaining that "map-details" can't
be reversed.
Fix:
{{{
urlpatterns = patterns("",
url(r'^servicemanagement/status/$',
"nwwcfh.servicestatus.views.map_details", name="map-details"),
}}}
(i.e. use double quotes instead of single quotes )
Why does this work? Don't know. But it took me the best part of a day to
figure this out!
--
Ticket URL: <http://code.djangoproject.com/ticket/8897>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---