From django docs about looping through form fields :
{{ field.errors }}
The output is a <ul class="errorlist"> containing any validation errors corresponding to this field. You can customize the presentation of the error with the loop {% for error in field.errors %} . In this case, each object in the loop is a simple string containing an error message.
So, for example, to wrap every error in the <p> tags, you would do:
{% for error in field.errors %} <p>{{ error|escape }}</p> {% endfor %}
Alasdair
source share