有没有办法在 cpanel 上部署 fastapi 应用程序?
Is there a way to deploy a fastapi app on cpanel?
我在使用 Passenger 的 cpanel 上部署 FastAPI 应用程序时遇到问题
您可以 运行 您的 FastAPI 应用程序使用 a2wsgi
:
在你的passenger_wsgi.py
中:
from a2wsgi import ASGIMiddleware
from main import app # Import your FastAPI app.
application = ASGIMiddleware(app)
应用了 python 包 a2wsgi 来解决问题,但它不起作用。
我在使用 Passenger 的 cpanel 上部署 FastAPI 应用程序时遇到问题
您可以 运行 您的 FastAPI 应用程序使用 a2wsgi
:
在你的passenger_wsgi.py
中:
from a2wsgi import ASGIMiddleware
from main import app # Import your FastAPI app.
application = ASGIMiddleware(app)
应用了 python 包 a2wsgi 来解决问题,但它不起作用。