[英]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 等不兼容。
Magnum是將 ASGI 應用程序與 AWS Lambda 和 API Gateway 一起使用的適配器,未針對 Google GCP 進行測試。
我建議遵循@di 的建議並在 Cloud Run 中使用 Uvicorn。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.