FastAPI: Router APIs is not working in cpanel
See original GitHub issueFirst Check
- I added a very descriptive title to this issue.
- I used the GitHub search to find a similar issue and didn’t find it.
- I searched the FastAPI documentation, with the integrated search.
- I already searched in Google “How to X in FastAPI” and didn’t find any information.
- I already read and followed all the tutorial in the docs and didn’t find an answer.
- I already checked if it is not related to FastAPI but to Pydantic.
- I already checked if it is not related to FastAPI but to Swagger UI.
- I already checked if it is not related to FastAPI but to ReDoc.
Commit to Help
- I commit to help with one of those options 👆
Example Code
# passenger_wsgi.py code
from a2wsgi import ASGIMiddleware
from app.main import app
application = ASGIMiddleware(app)
# main.py code
from fastapi import FastAPI
from .routers import authentication
import uvicorn
app = FastAPI(debug=True)
app.include_router(authentication.router)
@app.get("/", tags=['Welcome'])
def index():
return {"detail": "Welcome to APIs."}
Description
Hello Folks,
I have developed one application in FastAPI and it is working fine on my local machine. After hosting that application in Cpanel, main.py API is working but router APIs are not working. Not working means when I request URL it tell me “Not found”.
I have followed the file structure that is given in the FastAPI documentation.
Please let me know how can I resolve this issue.
Thanks.
Operating System
Linux
Operating System Details
No response
FastAPI Version
0.75.1
Python Version
3.7
Additional Context
No response
Issue Analytics
- State:
- Created a year ago
- Comments:11
Top Results From Across the Web
Failure to get FastAPI working with CPanel using a2wsgi
I set it up in cPanel using the python app (my host provider allows python scripts) with python 3.8.12 and do the pip...
Read more >Bigger Applications - Multiple Files - FastAPI
Starting in the same package that this module (the file app/routers/items.py ) lives in (the directory app/routers/ )... go to the parent package...
Read more >First Steps - FastAPI
FastAPI generates a "schema" with all your API using the OpenAPI standard for defining APIs. "Schema"¶. A "schema" is a definition or description...
Read more >Custom Request and APIRoute class - FastAPI
That way, the same route class can handle gzip compressed or uncompressed ... To solve this same problem, it's probably a lot easier...
Read more >Behind a Proxy - FastAPI
Up to here, everything would work as normally. ... Because we have a proxy with a path prefix of /api/v1 for our app,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
hello @yigitesen can you help me??? i am facing the same issue cpanel. it keeps on loading and then showing request timeout.
can you be more specific what actually needs to be done??
can you help me??? i am facing the same issue cpanel. it keeps on loading and then showing request timeout.
can you be more specific what actually needs to be done??