Constructing a wtforms\' TextAreaField is something like this:
content = wtf.TextAreaField(\'Content\', id=\"content-area\", validators=[validators.Required()])
For convenience, add this macro first.
_formhelpers.html
:
{% macro render_field(field) %}
- {{ field.label }}
- {{ field(**kwargs)|safe }}
{% if field.errors %}
{% for error in field.errors %}
- {{ error }}
{% endfor %}
{% endif %}
{% endmacro %}
Import this macro and code in this way. it should work.
{% from "_formhelpers.html" import render_field %}
Hope it helps !