'forms.LoginForm object' has no attribute 'hidden_tag'

问题遇到的现象和发生背景

在用flask做登录页面时想用bootstrap出现报错

问题相关代码,请勿粘贴截图
@app.route('/login', methods = ['GET', 'POST'])
def login():
    from forms import LoginForm
    form = LoginForm()
    return render_template('login.html', title=u'登录', form=form)
{% extends 'base.html' %}
{% import 'bootstrap/wtf.html' as wtf %}
{% block content %}
    <div class="page-header">
        <div class="container">
            <h1>{{ self.title()}}</h1>
        </div>
    </div>
    <div class="container">
        {{ wtf.quick_form(form) }}
<!--        <form method="post">-->
<!--            {{ form.username.label }}-->
<!--            {{ form.username() }}-->
<!--            {{ form.password.label}}-->
<!--            {{ form.password() }}-->
<!--            {{ form.submit() }}-->
<!--        </form>-->
    </div>
{% endblock %}


运行结果及报错内容

img

我的解答思路和尝试过的方法
我想要达到的结果

Apparently the arguments order for the model_form changed between versions [1] [2], so it should be called as:

UserForm = model_form(User, base_class=Form)

参考:


img