error is not displayed in the template
<p>I have used <strong>django allauth</strong> for user registration and login. I have used the <code>{{ form.has_errors }}</code> in template to show an error but the error is not displayed in the template. What might be the reason for not showing an error in the template? </p>

<p>The code from allauth <code>login.html(account/login.html)</code></p>

<pre><code>{% block content %}
&lt;div class="login-box"&gt;
      &lt;div class="row"&gt;
       &lt;div class="col-xs-12 col-sm-12 col-md-6 col-md-offset-3 login-area"&gt;
       &lt;span class="error"&gt;
          {% if form.has_errors %}
          &lt;p&gt;Your username and password didn't match. Please try again.&lt;/p&gt;
          {% endif %}
      &lt;/span&gt;
       &lt;div class="panel panel-default"&gt;
         &lt;div class="panel-heading login-header"&gt;{% trans "Sign In" %}&lt;/div&gt;
         &lt;div class="panel-body"&gt;
            &lt;form class="login" method="POST" action="{% url 'account_login' %}"&gt;
              {% csrf_token %}
              &lt;div class="form-group form-group-lg"&gt;
                &lt;label for="emailAddress"&gt;Email address&lt;/label&gt;
                &lt;input type="email" class="form-control" id="emailAddress id_login" name="login" placeholder="Email"&gt;
              &lt;/div&gt;
               &lt;div class="form-group form-group-lg"&gt;
                &lt;label for="password"&gt;Password&lt;/label&gt;
                &lt;input type="password" class="form-control" id="password id_password" name="password" placeholder="Password"&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                {% if redirect_field_value %}
                &lt;input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" /&gt;
                {% endif %}
              &lt;/div&gt;
              &lt;button class="btn-block signin-btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"&gt;{% trans "Sign In" %}&lt;/button&gt;
            &lt;/form&gt;
             &lt;/div&gt;
             &lt;div class="panel-footer"&gt;
                &lt;a class="button secondaryAction" href="{% url 'account_reset_password' %}"&gt;{% trans "Forgot Password?" %}&lt;/a&gt;
             &lt;/div&gt;
         &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
{% endblock %}
</code></pre>

<p>Seems to be a misunderstanding of <a href="https://docs.djangoproject.com/en/1.10/ref/forms/api/#django.forms.Form.has_error" rel="nofollow">has_error</a> </p>

<blockquote>
  <p>his method returns a boolean designating whether a field has an error
  with a specific error code. If code is None, it will return True if
  the field contains any errors at all.</p>
</blockquote>

<p>Coupled with the fact that you are rendering the form manually. Generally there are two types of form errors, non field errors and errors associated with each field (when their validation fails). The above method accepts a field name as a parameter and returns true if the field has failed validation.</p>

<p>You have several options, including continuing with your current approach but checking for <a href="http://Form.errors" rel="nofollow">form.errors</a> instead of <code>form.has_error</code> or displaying the error with each field separately.</p>

python django django-templates django-allauth django-1.9