title: Django form.errors not showing up in template
body: <p>I have refrenced <a href="https://stackoverflow.com/questions/14647723/django-forms-if-not-valid-show-form-with-error-message">this</a> stackoverflow page and tried to display my forms error on the html template.
  I did:</p>
  
  <pre><code>    {% if form.error %}
      {% for field in form %}
          {% for error in field.errors %}
              &lt;div class="alert alert-danger"&gt;
                  &lt;strong&gt;{{ error|escape }}&lt;/strong&gt;
              &lt;/div&gt;
          {% endfor %}
      {% endfor %}
      {% for error in form.non_field_errors %}
          &lt;div class="alert alert-danger"&gt;
              &lt;strong&gt;{{ error|escape }}&lt;/strong&gt;
          &lt;/div&gt;
      {% endfor %}
  {% endif %}
  </code></pre>
  
  <p>as said in the stackoverflow question I also tried simply doing:</p>
  
  <pre><code>{% if form.error %}
  This should pop up if there is an error
  {% endif %}
  </code></pre>
  
  <p>Nothing comes up regardless:
  Heres my view.py code:</p>
  
  <pre class="lang-python prettyprint-override"><code>def register(request):
      if request.method == 'POST':
          form = UserCreationForm(request.POST)
          if form.is_valid():
              form.save()
              username = form.cleaned_data.get('username')
              password = form.cleaned_data.get('password2')
              user = authenticate(username=username, password=password)
              login(request, user)
              return HttpResponseRedirect('/')
          else:
              print(form.errors)
      form = UserCreationForm()
      return render(request, 'registration/register.html', {'form': form})
  </code></pre>
  
  <p>I am able to get the form errors onto the django console but it refuses to show up on the template.</p>
  
  <p>Printing <code>form.errors</code> prints to the console: <code>&lt;li&gt;password2&lt;ul class="errorlist"&gt;&lt;li&gt;The two password fields didn&amp;#39;t match.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;</code></p>