I need to have a variable covars that contains an unknown number of entries, where each entry is one of three different custom Pydantic models. In this case, ea
when I use docker-compose to install a fastapi project, I got AssertionError: jinja2 must be installed to use Jinja2Templates but when I use env to install it,
Stack I am using: Python 3.10.x FastAPI 0.75.x SQLAlchemy 1.4.3x Summary I am building a unifying FastAPI project for several legacy databases (stored back-end
I am learning fastapi and created the sample following application from fastapi import FastAPI import uvicorn app = FastAPI() @app.get("/hello") async def hell
I have to create a very generic endpoint for a user. The user may send JSON data or may upload a file to this endpoint. There are multiple options on how to han
I want to refactor my code from sync to async. I use Python and FastAPI. I use the method which calls async function in Enumaration. For example: from enum impo
I wrote and API with RapidAPI and deployed it on Heroku. I then listed the API on RapidAPI marketplace which uses a x-rapidapi-proxy-secret header to help me ma
I want to save an image from the response body to my local directory. Here is my code: return Response(bytes_io.getvalue(), media_type= "image/jpeg")
I try to upload an image from my react-admin app to FastAPI using axios. The ImageInput component returns a File object which I cast to a Blob and try to upload
I'm trying to mimic Django behavior when running tests on FastAPI: I want to create a test database in the beginning of each test, and destroy it in the end. Th
I want to run a simple background task in FastAPI, which involves some computation before dumping it into the database. However, the computation would block it
Ubuntu 20.04LTS, with Python 3.8 for FastAPI, and Flutter 2.8.1, with Android SDK version 32.0.0. I am trying to send a Map from Flutter to FastAPI. I have figu
I have a page with a table of students. I added a button that allows you to add a new row to the table. To do this, I redirect the user to a page with input for
I made a REST service on python using FastAPI and I need to call the API using Javascript. This is my FastAPI server: class FieldUpdate(BaseModel): item_id: Opt
I have mounted the static directory in my FastAPI app using the following code: from fastapi.staticfiles import StaticFiles app = FastAPI( title="Title of
I'm doing a feature where the user on their profile page makes changes (not related to the user model). Everything is implemented through static HTML templates.
So, I'm swapping my project from node.js to python FastAPI. Everything has been working fine with node, but here it says that my static files are not present, s
I am trying to convert my CSV file into JSON by uploading it into FastAPI first, but when I try to process it directly (without storing it somewhere), I get err
I want to write BDD test cases for the Fast API framework where I have written some REST API. Though for normal test cases Fast API mentioned pytest package. Ba
I try to insert data to my MongoDB Database after scraping data. I did the exact same thing with NodeJS and Express, now I'm testing FastAPI. URI = '...' try: