繁体   English   中英

在 Google App Engine 中部署 Quart Python 应用程序

[英]Deploying a Quart Python app in Google App Engine

我正在尝试通过 Google Cloud 的 App Engine Standard 部署基于 Quart 的 Python 应用程序。 但是,我不断收到以下错误:

Traceback (most recent call last):
  File "/env/lib/python3.7/site-packages/gunicorn/workers/gthread.py", line 284, in handle
    keepalive = self.handle_request(req, conn)
  File "/env/lib/python3.7/site-packages/gunicorn/workers/gthread.py", line 333, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
TypeError: __call__() missing 1 required positional argument: 'send'

我知道 Quart 是一种 ASGI 解决方案,而 Google App Engine 是一种无服务器设置。 将 quart 部署到 AWS Lambda 的建议之一是使用 Magnum。 这也适用于 Google Cloud App Engine 吗?

任何帮助,将不胜感激。

来自https://github.com/pgjones/quart/issues/68

Quart 是一个 ASGI 框架,而不是一个 WSGI 框架,这意味着它不能与 serverless 一起工作。 它可以与Mangum 一起使用,这是无服务器的 ASGI 替代品。

这也意味着 Quart 将与 App Engine、Cloud Functions 等不兼容。

但是,它可以通过支持 ASGI 的 HTTP 服务器(例如Uvicorn )Cloud Run配合使用

Magnum是将 ASGI 应用程序与 AWS Lambda 和 API Gateway 一起使用的适配器,未针对 Google GCP 进行测试。

我建议遵循@di 的建议并在 Cloud Run 中使用 Uvicorn。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM