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>Try this one. Errors raised by the form which is not attached to field are stored in non_field_errors</p>

<pre><code> {% if form.non_field_errors %}
          &lt;ul class='form-errors'&gt;
              {% for error in form.non_field_errors %}
                  &lt;li&gt;{{ error }}&lt;/li&gt;
              {% endfor %}
          &lt;/ul&gt;
  {% endif %}
</code></pre>

<p>or if you want to display in your way try this one</p>

<pre><code>{% if form.errors %}
          &lt;p&gt;Your username and password didn't match. Please try again.&lt;/p&gt;
{% endif %}
</code></pre>

python django django-templates django-allauth django-1.9