并行线程中的Flask/SQLAlchemy查询

2024-04-19 18:53:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我有基于odFlask-Cookiecutter的web应用程序。我的应用程序是同步的,但是我需要使用进度条的异步请求和百分比进度。在

对于这个请求,我需要在第二个线程上使用SQLAlchemy(只读,不写)。在

当我尝试“传统方式”:User.query.all()我得到的答案只有:

raise RuntimeError('application not registered on db '
RuntimeError: application not registered on db instance and no application bound to current context

你能帮我选这个吗?在

谢谢你的回答。在


Tags: 进度条web应用程序dbapplicationsqlalchemyonnot