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
  • 43,201
  • 71
  • 221
  • 382

1 Answers1

4

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

miku
  • 181,842
  • 47
  • 306
  • 310