Category "fastapi"

500 Undocumented Error: Internal Server Error when returning response in FastAPI

I am using FastAPI to make predictions using a ML model. When I give a task_id and input, the app should add it to the background task and return the response a

How to share variables between HTTP requests in FastAPI?

I wonder how can I share the value of variables between HTTP requests in FastAPI. For instance, I have a POST request in which I get some audio files and then I

Python ModuleNotFoundError while importing a module in conftest for Pytest framework

My project structure mt-kart | --> src/data_kart | | | -->apis | | | -->__init__.py |

FastAPI (starlette) get client real IP

I have an API on FastAPI and i need to get the client real IP address when he request my page. I'm ty to use starlette Request. But it returns my server IP, no

FastAPI: app.dependency_overrides affects other test files

I'm working with FastAPI. I've introduced in my test suite (pytest) app.dependency_overrides to test my app dependencies. Strangely enough, when I use it in a t

FastAPI - How to upload file via form

I am making a REST API that requires uploading files. For testing purposes, I am uploading files through postman, but I don't know how to access the files on se

Displaying of FastAPI validation errors to end users

I'm looking for some library or example of code to format FastAPI validation messages into human-readable format. E.g. this endpoint: @app.get("/") async def h