def run_ctx_request(environ):
from blueprints import app
# environ ????
# request body ?? in-memory-buffer ???????
# ??????????
if '_wsgi.input' in environ:
environ['wsgi.input'] = BytesIO(environ['_wsgi.input'])
with app.request_context(environ):
g.in_celery = True
try:
rv = app.full_dispatch_request()
except:
if app.debug:
raise
rv = app.make_response(InternalServerError())
return (rv.get_data(), rv.status_code, rv.headers)
评论列表
文章目录