Is there a way to hide the csrf label while looping through form using Flask and Flask-WTForms?

前端 未结 5 901
隐瞒了意图╮
隐瞒了意图╮ 2020-12-15 16:43

I have very simple contact form and I would like to hide the label somehow so that it doesn\'t show Csrf Token. I am using Flask and Flask-WTForms and am render

5条回答
  •  没有蜡笔的小新
    2020-12-15 17:12

    I have found the way to do it like this:

    {% if field.id != 'csrf_token' %}
    

    I believe this to be less hacky. I found this from modifying the example here in the docs.

提交回复
热议问题