烧瓶,在流程内使用渲染模板

时间:2020-04-23 22:53:06

标签: python python-3.x multithreading flask process

当我尝试在诸如render_template或current_user之类的进程中执行flask函数时,该进程出错..如何在进程内使用flask应用程序?非常感谢你

def export_to_file(file_id):
    with app.app_context():

        istanza = FileTemporanei.query.get(file_id)
        path = f"myapp/folder/{current_user.id}"

这是在流程中执行的代码,当在流程current_user.id中执行时,我什么也不会返回

0 个答案:

没有答案