I have an api which is representative of the structure of: from fastapi import FastAPI, Depends, Request, APIRouter class SomeManager: def get_value_from
Basically, I'm trying to create an endpoint to Upload files to Amazon S3. async def upload_files(filepath: str, upload_file_list: List[UploadFile] = File(...)):
Specifically, I want the below example to work: from typing import List from pydantic import BaseModel from fastapi import FastAPI, UploadFile, File app = Fas
I've this error: crew.js:6 Uncaught TypeError: Cannot read properties of undefined (reading 'first') From an API (I'm using FastAPI for backend) I've this ret
I am trying to restrict one field in a class to an enum. However, when I try to get a dictionary out of class, it doesn't get converted to string. Instead it re
I have two postgres databases, one for prod and another for testing in "DATABASE_URI" and "TESTDATABASE_URI" respectively. The app seems to working perfectly, w
I have the following code: import time from fastapi import FastAPI, Request app = FastAPI() @app.get("/ping") async def ping(request: Request):
I have built authentication similar to what is described in the documentation. So I have this dependency copied from there: async def get_current_user(token: st
I try to make a backend server based on fastapi. My backend server works well with almost no errors, but I found an error situation. I allocate two services to
I have a GET method with request parameter in path: @router.get('/users/{user_id}') async def get_user_from_string(user_id: str): return User(user_id) Is i
I'm new to FastAPI (migrating from Flask) and I'm trying to create a Pydantic model for my GET route: from fastapi import APIRouter,Depends from pydantic import
I have an endpoint that recibe and id field used to get data from MongoDB's _id: from fastapi import APIRouter from bson import ObjectId router = APIRouter()
I am trying to render an HTML page that shows video streaming from a webcam. However, I am facing the following error: 500 Server Error TypeError: TemplateRespo
I want to use FastAPI. I installed it using pip, and when I am adding it to my project like that: from fastapi import FastApi and running it, Iam getting the
I want to use slowapi on a fastapi python app, for implementing RateLimiter. However, The definitions of the endpoints use a data model for parameters (inheriti
I'm uploading zip files as UploadFile via FastAPI and want to save them to the filesystem using async aiofiles like so: async def upload(in_file: UploadFile = F
Example Here's my code: from typing import List from fastapi import FastAPI, File, UploadFile import asyncio import concurrent.futures app = FastAPI() @app.po
Using a ORM, I want to do a POST request letting some fields with a null value, which will be translated in the database for the default value specified there.
In FastAPI to pass a list of dictionary, generally we will define a pydantic schema and will mention as: param: List[schema_model] The issue I am facing is tha
When I use GET request to send data to the server it works fine, but when use POST request it throws "422 Unprocessable Entity" error. This is my Ajax request c