#24594: urlpatterns as list breaks template code
-------------------------------+--------------------
Reporter: stephanm | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
According to
https://docs.djangoproject.com/en/1.8/releases/1.8/#django-conf-urls-
patterns
I switched a working project from
{{{#!py
urlpatterns = patterns('',
url(r'^$', 'myapp.views.index', name="home"),
)
}}}
to
{{{#!py
urlpatterns = [ url(r'^$', myapp.views.index, name="home"), ]
}}}
But now I get the exception:
{{{
Exception Type: AttributeError
Exception Value:
'list' object has no attribute 'regex'
Exception Location: D:\Programme\python27\lib\site-
packages\django\core\urlresolvers.py in _populate, line 298
}}}
Because I have the following code snippet in my html template:
{{{
{% url 'home' %}
}}}
----
'''Another item:''' In my settings.py I have
{{{#!py
LOGIN_URL = "/myapp/auth/login/"
}}}
which breaks too.
This one works (at least) if I change it to:
{{{#!py
LOGIN_URL = "myapp.views.login"
}}}
System: I use python 2.7.9 (32 bit) on Windows 7 64 bit.
--
Ticket URL: <https://code.djangoproject.com/ticket/24594>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.5f1865a60ef6c070923af4afc2d47453%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.