[Flask] Help with Flask-WTF

David Lord davidism at gmail.com
Sat May 6 23:32:22 EDT 2017


You're using a WTForms Form, not a Flask-WTF FlaskForm. I guess quick_form
doesn't handle that.

On May 6, 2017 08:17, "Lorenzo Mainardi" <lormayna at gmail.com> wrote:

> Hello, I'm trying to do something with Flask-Bootstrap and Flask-WTF. This
> is my app.py:
>
> from flask import Flask
> from flask_wtf.csrf import CsrfProtect
> from flask_bootstrap import Bootstrap
>
> app = Flask(__name__)
> Bootstrap(app)
> CsrfProtect(app)
>
> This is my template:
>
> {% extends "bootstrap/base.html" %}
> {% import "bootstrap/wtf.html" as wtf %}
>
> {% block title %}
>
> {% endblock %}
>
> {% block content %}
> {{ wtf.quick_form(form) }}
> {% include "footer.html" %}
> {% endblock %}
>
> This is the traceback (only last line):
>
>   File "/home/lorenzo/projects/broen/lib/python2.7/site-packages/flask_bootstrap/templates/bootstrap/wtf.html", line 200, in template
>     {{ form.hidden_tag() }}
> UndefinedError: 'forms.SignupForm object' has no attribute 'hidden_tag'
>
> All packages are installed via pip. Could you help me to solve it? Regards
>
> --
> LORENZO MAINARDI
> http://blog.mainardi.me
>
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20170506/d770384e/attachment.html>


More information about the Flask mailing list