WTForms getting the errors
A cleaner solution for Flask templates:
Python 3:
{% for field, errors in form.errors.items() %}<div class="alert alert-error"> {{ form[field].label }}: {{ ', '.join(errors) }}</div>{% endfor %}
Python 2:
{% for field, errors in form.errors.iteritems() %}<div class="alert alert-error"> {{ form[field].label }}: {{ ', '.join(errors) }}</div>{% endfor %}