运行此代码时出现此错误: NameError:名称“ request”未定义
这是我的代码
from app import app
from app import celery
@app.route("/name_async", methods=["POST"])
def name_call_async():
name.delay()
return 'async request'
@celery.task(name='run.name')
def name():
a = request.form.get('NAME')
return a
答案 0 :(得分:0)
您不导入request
from flask import request