Issue
I have an existing Flask application and am trying to add the Flask-Blogging extension to it. Adding the extension raises ImportError: cannot import name FlaskForm
when flask_blogging
tries from flask_wtf import 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
I am using Flask 0.11.1 and Flask-WTF 0.12.
Solution
You have an old version of Flask-WTF installed, but Flask-Blogging expects a newer version. Upgrade Flask-WTF.
pip install -U Flask-WTF
Flask-WTF renamed Form
to Flask-Form
in version 0.13, released September 29, 2016.
Answered By - davidism
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.