python - AttributeError: 'str' object has no attribute 'regex' -
working legacy django 1.3.1 , having problem in using url name patterns in template.
urls.py :
urlpatterns = patterns( 'project.views', url(r'^web/login/', 'login', name="web_login"), )
in views rendering template like:
return render_to_response('index.html', context_instance=requestcontext(request))
in template using url naming pattern like
<form id="loginform" action="{% url web_login %}" method="post">
getting error while rendering template
attributeerror: 'str' object has no attribute 'regex'
you forgot quote marks.
action="{% url 'web_login' %}"
Comments
Post a Comment