{% comment %}
The include path here is a variable, but it always comes from Widget.template_name.
Never let this path come from submitted data; an attacker could then load any template.
{% endcomment %}
{% comment %}
The p layout passes ``span`` as ``row_tag``. Its row is inside a Django ``p``.
Use phrasing content in that row. A ``ul`` start tag closes the ``p``.
The other layouts include Django's ``ul`` error template.
{% endcomment %}
{% if row.errors %}
{% if row_tag == "span" %}
{% for error in row.errors %}{{ error }}{% if not forloop.last %} {% endif %}{% endfor %}
{% else %}
{% include "django/forms/errors/list/ul.html" with errors=row.errors error_class=row.errors.error_class only %}
{% endif %}
{% endif %}
{% include row.subwidget.template_name with widget=row.subwidget only %}