question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FastAPI: Router APIs is not working in cpanel

See original GitHub issue

First 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:closed
  • Created a year ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
Tusar0003commented, Jun 21, 2022

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??

0reactions
sysalongcommented, Nov 29, 2022

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??

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found