<div>
    {% for term, errors in terms_with_errors %}
        <h4>{{ term.name }}</h4>
        <ul>
        {% for error in errors %}
            <li>{{ error }}</li>
        {% endfor %}
        </ul>
    {% endfor %}
</div>