Category "fastapi"

Will Nginx run a Python FastAPI endpoint app?

I don't see this answered directly, so it's confusing. None of the tutorials I can find are using Nginx. They use Uvicorn instead for their examples. I have a r

How to change the default Pydantic error message using FastAPI?

Is there any way to change the default response from Pydantic so that "msg" is "message"? { "detail": [ { "loc": [ "body

AWS SAM-lambda: Cannot import from parent directory containing a fastapi app

I'm trying to deploy a fastapi application to AWS lambda using the SAM client. The issue is that I cannot get Lambda to recognize the parent folder. I have a fa

How to run background task in parallel (python, FastAPI)

I am currently developing an API that has several endpoints. One of them is to register data in a database, other endpoints are related to simple CRUD endpoints

How can I read UploadFile in FastAPI?

I have a FastAPI endpoint that receives a file, uploads it to s3, and then processes it. Everything works fine except for the processing, that fails with this m

How to run FastAPI server as multiple instances

I have developed a FastAPI Web Application. If I run the server and it is down or crashed for some reason. I need multiple instances of server to be running. I

iOS - Failed to upload video file from swift to FastAPI server

I took the code for uploading the video file from this question, however, an error occurs. This is the code to select a video from an album: var videoURL: URL?

Getting "Failed to establish a new connection: [Errno -3] Temporary failure in name resolution" in Uvicorn server in Docker environment

I am getting the below exception while making a call from my project- My code is deployed on Docker and inside it running python uvicorn server. I have double c

FastAPI: How to use POST data as variable to trigger another script?

I have written an API on FastAPI with filename api.py: from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Username(BaseMode

get_current_user doesn't work (OAuth2PasswordBearer problems)

This is actually the first time it doesn't work, I mean I've practiced this before, but now I have no idea what's wrong. So I am trying to implement basic func

Define a Request parameter as an optional variable type in fastapi

I would like to define a Request object as an optional variable type in FastAPI, but I got an error: fastapi.exceptions.FastAPIError: Invalid args for response

FastAPI swagger don't use custom header

I want to add "Authorization" header to the my FastAPI application. I did it by documentation, but when i try to execute request in the swagger - it doesn't wor

Intermittent CORS issue with FastAPI deployed on Heroku

I deployed a FastAPI based backend on Heroku and whenever I query the url via cURL or Postman, it works fine. However, when it queried from a chrome extension (

FastApi pydantic: Json object inside a json object validation error

There is a nested rule of class DocumentSchema in pydantic written in FastApi as follows: class DocumentSchema(BaseModel): clientName: str transactionId

Is there any way we can integrate terraform with fastapi?

Is there a way to call terraform deployment utility in service endpoint(fastapi, flask) To summarize Integration of service endpoint with Terraform?

starting container process caused: exec: "uvicorn": executable file not found in $PATH: unknown

I'm trying to Dockerize my FastApi app, but it crash with this error right after I run the command, docker-compose -f local.yml up -d. Some one can help me plea

AttributeError: 'Depends' object has no attribute 'query' FastAPI

So I am trying to write simple function here, but everytime I run swagger I got above mentioned error. Here's my function: def authenticate_user(username: str,

FastAPI psycopg2 error when creating database for tests

I'm trying to test my database in my FastAPI app. from fastapi.testclient import TestClient from sqlalchemy import create_engine from sqlalchemy.orm import sess

FastAPI route: Adding dynamic path parameters validation

I'm trying to add validation to my route in a fastapi server, followed the instructions here and managed to have added validation on my int path parameters like

How to write a custom FastAPI middleware class

I have read FastAPI's documentation about middlewares (specifically, the middleware tutorial, the CORS middleware section and the advanced middleware guide), bu