使用Python+SQLAlchemy链接数据库并创建表时报错

问题

使用Python+SQLAlchemy链接数据库并创建表时报错

报错信息

RuntimeError: Working outside of application context.

This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.

环境

flask经典问题,和sqlalchemy倒是关系不大

怎么解决啊,教教我大佬

时序问题

有没有详解的文章分享下呀