Flask - AssertionError: The sqlalchemy extension was not registered to the current application. Please make sure to call init_app() first.解决方案
flask实现创建数据库表,处理The sqlalchemy extension was not registered to the current application报错的解决文案
1 # 模板命令三连 2 python manage.py db init 3 python manage.py db migrate 4 python manage.py db upgrade
先到初始化app
所以,manager = Manager(app)
前面加上一行代码db.init_app(app)
如下:
然后删除migrations文件,重新命令三连 ; OK 成功了!