运行以下代码时出现此错误:名称错误:未定义名称"请求">
这是我的代码
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
您不导入request
from flask import request