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

标签 python google-app-engine google-cloud-platform google-app-engine-python quart

我正在尝试通过 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/

相关文章:

python - 在cmd中设置类似于java和python的变量名

google-app-engine - 如何在 IntelliJ IDEA 12 中重置 AppEngine 密码?

docker - GCP 容器推送不起作用 - "denied: Please enable Google Container Registry API in Cloud Console at ..."

azure - 如果使用负载均衡器,还需要支付互联网导出费用吗?

python - Numpy:Row Wise Unique 元素

python - 如何解析 Python3 BeautifulSoup 中的 onclick() 文本?

android - 如何使用多个 OAUTH 提供商在 App Engine 上安全地注册用户?

java - 查找 App Engine 数据存储区列中的最大值

google-cloud-platform - Cloud Dataproc 错误 - GDC 中的 "Failed to load"

python - 将 Theano.scan 与共享变量一起使用