gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 20:00:21 26 4
gpt4 key购买 nike

我正在尝试通过 Google Cloud 的 App Engine 标准部署基于 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 is an ASGI framework, rather than a WSGI framework, which means that it cannot work with serverless. It can work with Mangum, which is an ASGI alternative to serverless.

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

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

关于python - 在 Google App Engine 中部署 Quart Python 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59276760/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com