I'm having trouble deploying a FastAPI app on cpanel with Passenger
Is there a way to deploy a fastapi app on cpanel?
Passenger at the moment only supports WSGI. FastAPI uses ASGI, so it's not possible to deploy it on Passenger at the moment. There is an open issue to support ASGI apps on passenger: github.com/phusion/passenger/issues/2272 There also is an issue on asgiref to convert ASGI to WSGI: github.com/django/asgiref/issues/109 –
Oralla
You might be able to run your FastAPI app using a2wsgi
:
In your passenger_wsgi.py
:
from a2wsgi import ASGIMiddleware
from main import app # Import your FastAPI app.
application = ASGIMiddleware(app)
How to start this app with uvicorn? –
Foldaway
i applied it for a django app but it didn't work. –
Insatiate
@Insatiate Django already uses the WSGI spec. You don't need to convert it in any way. See phusionpassenger.com/library/deploy/wsgi_spec.html for reference. –
Oralla
@Oralla i wanted to use the "django channels" library and it uses asgi. –
Insatiate
© 2022 - 2024 — McMap. All rights reserved.