I got the same issue. And I solved it doing this:
urlpatterns= patterns('',
(r'^login/$', 'django.contrib.auth.views.login'), <-----Remove the last comma in the patterns()
)
Hope this helps
On Friday, May 18, 2012 5:58:28 AM UTC+8, refreegrata wrote:
Hello listI know, this question has been posted and resolved before, but the solutions don't work in my situation. I don't know why.When I try to use the "url" tag in any template an exception is raised:"'str' object has no attribute 'regex'"for example, with this I got the error:------------------------------------ urls.py (main)------------------------------------- from django.conf.urls import patterns, include, urlurlpatterns= patterns('',(r'^registration/', include('apps.registration.urls')), (r'', 'django.contrib.auth.views.login'), )------------------------------------- urls.py (registration)----------------------------------------- from django.conf.urls import patterns, include, urlurlpatterns= patterns('',(r'^login/$', 'django.contrib.auth.views.login'), )----------------------------------------- login.html (in templates/registration)------------------------------------------------------------ - {{ form }}{% url "django.contrib.auth.views.login" %} <---here is the problem. It's just an stupid test for the problem ------------------------------------------------------------ - Fail with:- {% url django.contrib.auth.views.login %} - {% url 'django.contrib.auth.views.login' %} - {% url "django.contrib.auth.views.login" %} I add this at the end of the file "settings.py":---------------------------------------------------------- import django.templatedjango.template.add_to_builtins('django.templatetags. future') ---------------------------------------------------------- Including or excluding the last lines doesn't matter. The problem appear in the both cases.I'm using Django 1.4, and Python 2.6 over Centos 6.2. Maybe I must to include something else in the settings?Thanks for read and sorry for my bad english.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment