I made this many times and it worked, but not this time.
I get this error when I try to use {% url path.to.view %} django's template tage:
AttributeError at /login/ 'str' object has no attribute 'regex'
urls.py (main)
urlpatterns= patterns('', (r'', include('authenticate.urls')), )
urls.py (my app)
urlpatterns= patterns('authenticate.views', url(r'^login/$','login'),)
login.html
{{ form }}
{% url authenticate.views.login %} < --- Error comes here
in the views:
return render_to_response('login.html',{'form':form},context_instance=RequestContext(request), )
Doesn't also work with:
{% url authenticate.views.login %}
{% url 'authenticate.views.login' %}
{% url "authenticate.views.login" %}
This is on django 1.4; what possibly I'm doing wrong, or what do I miss in that version of django?
Thanks in Advance!
Update:
I can also add that using reverse in my views doesn't work and gives me the same error above:
from django.core.urlresolvers import reverse
result = reverse('django.contrib.auth.views.password_reset')
HttpResponse(result)
Error:
AttributeError at /abc/ 'str' object has no attribute 'regex'