gpt4 book ai didi

python - 无法从 Flask-WTF 导入 FlaskForm

转载 作者:行者123 更新时间:2023-12-01 16:14:15 24 4
gpt4 key购买 nike

我有一个现有的 Flask 应用程序,并且正在尝试向其中添加 Flask-Blogging 扩展。当 flask_blogging 尝试 fromflask_wtf import FlaskForm 时,添加扩展会引发 ImportError:cannot import name FlaskForm

Traceback (most recent call last):
File "run.py", line 11, in <module>
blog_engine = BloggingEngine(app, sql_storage)
File "/usr/local/lib/python2.7/dist-packages/flask_blogging/engine.py", line 66, in __init__
self.init_app(app, storage)
File "/usr/local/lib/python2.7/dist-packages/flask_blogging/engine.py", line 96, in init_app
from .views import create_blueprint
File "/usr/local/lib/python2.7/dist-packages/flask_blogging/views.py", line 11, in <module>
from flask_blogging.forms import BlogEditor
File "/usr/local/lib/python2.7/dist-packages/flask_blogging/forms.py", line 1, in <module>
from flask_wtf import FlaskForm
ImportError: cannot import name FlaskForm

我正在使用 Flask 0.11.1 和 Flask-WTF 0.12。

最佳答案

您安装了旧版本的 Flask-WTF,但 Flask-Blogging 需要更新版本。升级 Flask-WTF。

pip install -U Flask-WTF

Flask-WTF renamed Form to Flask-Form in version 0.13, released September 29, 2016.

关于python - 无法从 Flask-WTF 导入 FlaskForm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48370668/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com