title: Django access form errors excluding non_field_errors in template
body: <p>In a django template I'd like to show all form errors on top of the form,
  the easiest way is by doing so:</p>
  
  <pre><code>{{ form.errors }}
  </code></pre>
  
  <p>The problem is that this also shows the <code>form.non_field_errors</code>, these are the entries contained in <code>form.errors['__all__']</code>.</p>
  
  <p>I want to show these special errors separately, so I've tried to loop over the dict and check if the key existed:</p>
  
  <pre><code>{% for err in form.errors %}
    {% if not err.__all__ %}
      {# print error #}
    {% endif %}
  {% endfor %}
  </code></pre>
  
  <p>but apparently this is not possible because in the template we cannot access dictionary keys starting with underscore (<a href="https://docs.djangoproject.com/en/1.11/ref/templates/api/#variables-and-lookups" rel="nofollow noreferrer">doc</a>).</p>
  
  <p><strong>Question</strong>: is there a built-in way to access (and possibly print) the standard field errors and separately the non_field_errors?</p>
  
  <p><strong>Solution</strong> 
  This was built on top of Daniel Roseman's <a href="https://stackoverflow.com/a/48439670/1191416">answer</a>:</p>
  
  <pre><code>{% if form.errors %}
      &lt;div class="ui error icon message"&gt;
          &lt;ul&gt;
              {% if form.non_field_errors %}
                  {% for error in form.non_field_errors %}
                      &lt;li&gt;{{ error|escape }}&lt;/li&gt;
                  {% endfor %}
              {% endif %}
  
              {% for field in form %}
                  {% if field.errors %}
                      &lt;li&gt; {{ field.name }}
                          &lt;ul&gt;
                              {% for error in field.errors %}
                                  &lt;li&gt;{{ error|escape }}&lt;/li&gt;
                              {% endfor %}
                          &lt;/ul&gt;
                      &lt;/li&gt;
                  {% endif %}
              {% endfor %}
          &lt;/ul&gt;
      &lt;/div&gt;
  {% endif %}
  </code></pre>