RuntimeError:working outside of application context. Flask使用SQLAlchemy数据库
问题
RuntimeError:working on outside of application context.
本质:依赖包版本不匹配
flask-sqlalchemy、SQLALchemy 版本过高导致,换低版本
pip install flask-sqlalchemy==2.5.1
pip install SQLALchemy==1.4.32