python - Error NoReverseMatch -
i keep running in noreversematch
error on django 1.10, while earlier versions have no problems it.
rendered template:
{% extends "loginbase.html" %} {% block content %} <h1>login:</h1> <form class="form-horizontal" role="form" method="post" action="{% url 'django.contrib.auth.views.login' %}"> {% csrf_token %} {% if form.errors %} <p>your username , password didn't match. please try again.</p> {% endif %}
urls.py
url(r'^login/$', views.login, {'template_name': 'login.html', 'authentication_form': loginform}, name='login'),
any ideas on problem might be?
in django 1.10, you can no longer reverse urls using python dotted path, e.g. 'django.contrib.auth.views.login
'.
you have name='login'
in url pattern,
url(r'^login/$', views.login, {...}, name='login'),
so use in url tag:
{% url 'login' %}
Comments
Post a Comment