Questions tagged [fastapi]
FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints.
fastapi
7,084
questions
0
votes
0
answers
28
views
FastAPI: 422 Unprocessable Entity Error on POST /submit_response with Form and File Upload
Question:
I am working with a FastAPI application where I am trying to handle a form submission with an optional file upload. However, I am encountering a 422 Unprocessable Entity error when sending a ...
0
votes
1
answer
18
views
SQLAlchemy delete Method: Valid Strategies for synchronize_session in Bulk Deletion
I'm working on a FastAPI project where I need to perform a bulk deletion of jobs using SQLAlchemy. The list of job IDs to be deleted is provided via a POST request from Postman. However, I'm ...
1
vote
1
answer
20
views
Why can't my FastAPI Router parse Pydantic's Enum type when I use Union params?
My Question
Here is the definition of my three Pydantic Model:
class SplitType(str, enum.Enum):
AUTO = "auto"
CUSTOM = "custom"
class DocumentConfigBase(BaseModel):
'''...
0
votes
0
answers
19
views
UnicodeDecodeError with FastAPI when Handling Audio Files: How to Resolve?
I'm encountering a UnicodeDecodeError in my FastAPI application while processing audio files. The error traceback is as follows:
Traceback (most recent call last):
File "C:\Users\sanja\AppData\...
1
vote
0
answers
35
views
How can I read the response body in a FastAPI middleware without making my endpoint wait for its background tasks to finish? [duplicate]
Sure, here is a clearer version of the text in English:
The provided code shows a FastAPI middleware implementation, which performs an operation with the HTTP response details before returning the ...
-2
votes
0
answers
19
views
What exactly happens when I spawn 5 workers using Gunicorn in PROD for Fast API? [duplicate]
So my understanding is that workers should usually be 2 * cores + 1. Lets suppose I have a 2 core machine and spawned 5 workers in a PROD instance.
How does it work under the hood ?
Does Fast API ...
0
votes
0
answers
11
views
Turn off Azure Telemetry when param debug==True
Question of code quality:
Is there a better way to implement a separate debug flow/turn off opentelemetry for a FastAPI endpoint in Python rather than separating the functionality (separate function) ...
0
votes
1
answer
40
views
Applying a filter before joining tables
How can I filter joining table results ?
I have 3 tables:
User:
id: str
full_name: str
is_active: bool # NEED TO FILTER BY THIS
tags: Mapped[list["Tag"]] = relationship(
"...
1
vote
1
answer
34
views
FastAPI: How to handle Plotly graph click events in a web application?
I am using FastAPI to create a simple web app where I want to render a Plotly graph and record the (x, y) values when the graph is clicked. I am exporting the graph and then trying to set up an event ...
1
vote
1
answer
21
views
sqlalchemy orm selectinload not working at the get-all level
This is driving me crazy. As an example, I have a many-to-many relationship between tables called labels and tasks. Take this code excerpt for a filtered record:
statement = select(Label)....
0
votes
1
answer
19
views
Sqlalchemy + FastAPI. Return ORM model result with nested childs
I have table "categories" with subcategories. Subcategories are determined by "parent_id".
I want to find a way to return an object from FastAPI's endpoint like this:
[
{
&...
0
votes
1
answer
65
views
fastapi : "GET /docs HTTP/1.1" 404 Not Found [closed]
I recently updated fast api from v0.89.1 to v0.110.0 and I am getting the following error.
"GET /docs HTTP/1.1" 404 Not Found
There is no other error to help me debug the issue.
INFO: ...
-1
votes
0
answers
18
views
I want to see the name of file what i transfer on client html with Python, FastAPI, MPD, dashjs, manifest.mpd, [duplicate]
I want to see the file name on client html but i can't find the way. I searched whole way but couldn't. Here is my code.
Directory
/server.py
/static/index.html
/dash/.../manifest.mpd
server.py
from ...
-2
votes
0
answers
12
views
Integrate @web3auth/single-factor-auth in a FastAPI Application
I'm working on migrating an application from NestJS to FastAPI and need help integrating Web3Auth's @web3auth/single-factor-auth SDK into my FastAPI project. In my NestJS application, I used the ...
0
votes
0
answers
21
views
Issues with environment variables during deployment
I'm trying to deploy a FastAPI application on Render and I'm encountering an issue. When I attempt to deploy the application, I receive the following errors:
==> Exited with status 1
==> Common ...