
AssertionError: The sqlalchemy extension was not registered to the current application. Please make sure to call init_app() first.
今天在进行数据迁移时,执行到 python migrate.py db migrate 时候 报错
经过反复试验,在配置上加上
db.init_app(app)
执行成功!
在执行Python数据迁移时遇到AssertionError,提示SQLAlchemy扩展未注册到当前应用。通过在配置中添加`db.init_app(app)`解决了问题,确保在运行前正确初始化了应用。

AssertionError: The sqlalchemy extension was not registered to the current application. Please make sure to call init_app() first.
今天在进行数据迁移时,执行到 python migrate.py db migrate 时候 报错
经过反复试验,在配置上加上
db.init_app(app)
执行成功!
3716
1618
482
1万+
474
1414

被折叠的 条评论
为什么被折叠?