1

Is there a direct way of listing out all form errors in Django templates. I'd like to list out both field and non-field errors and any other form errors.

I've found out how to do this on a per-field basis but as said earlier, I'd like to list out everything.

The method I'm using doesn't seem to list out everything.

{% for error in form.errors %}
{{ error|escape }}
{% endfor %}

Thanks.

Mridang Agarwalla
  • 40,471
  • 69
  • 211
  • 366

1 Answers1

4

You could loop over all the field in addition to non-field errors:

miku
  • 172,072
  • 46
  • 300
  • 307