form.has_errors tag not working
- by John
Hello,
Im using Django 1.2.3. I have login functionality in my site using django.contrib.auth.views.login. The user is able to login after entering correct username and password. But, form.has_errors is not working i.e. if the login credentials entered are incorrect i dont see the error message. My login.html in templates/registration is as follows :
<html>
<head>
<title>Login</title>
</head>
<body>
<h1>User Login</h1>
{% if form.has_errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}
<form method="post" action=".">
{% csrf_token %}
<p><label for="id_username">Username:</label> {{ form.username }}</p>
<p><label for="id_password">Password:</label> {{ form.password }}</p>
<input type="hidden" name="next" value="/" />
<input type="submit" value="login" />
</form>
</body>
</html>
Any way to fix this problem?
Please Help
Thank You.