【问题标题】:Is there a way to deploy a fastapi app on cpanel?有没有办法在 cpanel 上部署 fastapi 应用程序?
【发布时间】:2021-03-14 18:38:59
【问题描述】:

我在使用 Passenger 的 cpanel 上部署 FastAPI 应用程序时遇到问题

【问题讨论】:

标签: python cpanel passenger fastapi


【解决方案1】:

您或许可以使用 a2wsgi 运行您的 FastAPI 应用:

在你的passenger_wsgi.py:

from a2wsgi import ASGIMiddleware
from main import app  # Import your FastAPI app.

application = ASGIMiddleware(app)

【讨论】:

  • 如何用uvicorn启动这个应用?
【解决方案2】:

应用了python包a2wsgi来解决问题,但它不起作用。

【讨论】:

    猜你喜欢
    • 2021-03-16
    • 2013-05-02
    • 1970-01-01
    • 2018-12-26
    • 2011-01-01
    • 1970-01-01
    • 2020-05-17
    • 2018-07-26
    • 2020-07-02
    相关资源
    最近更新 更多