Category "fastapi"

FastApi urls path and 2 values into a query

im using FastApi and get some troubles with url. i have a root url @app.get("/myurl") http://host/myurl and http://host/myurl?id=2 and here function returns

in many-to-many relationships, can you delete a row from one table without deleting any rows from the second table?

I am creating a database & working on CRUD functions. I've run into a problem with the Delete functionality. I have two tables, connected in a many-to-many

How do I serve a React-built front-end on a FastAPI backend?

I've tried to mount the frontend to / with app.mount, but this invalidates all of my /api routes. I've also tried the following code to mount the folders in /st

Download PDF file using pdfkit and FastAPI

I am going to create an API that converts an HTML page to a PDF file. I made it using pdfkit and FastAPI. However, it saves the file to my local disk. After I s

Set description for query parameter in swagger doc using Pydantic model (FastAPI)

This is continue to this question. I have added a model to get query params to pydantic model class QueryParams(BaseModel): x: str = Field(description="quer

Celery, uvicorn and FastAPI

I have a FastAPI api code that is executed using uvicorn. Now I want to add a queu system, and I think Celery and Flower can be great tools for me since my api

Separate FastApi documentation into sections

Currently the OpenAPI documentation looks like this: Is it possible to separate it into multiple sections? For example, 2 sections, one being the "books" secti

The 'uvloop>=0.14.0' distribution was not found and is required by uvicorn

I'm new at learning FastAPI, and I'm getting stuck at the very beginning. I keep getting the following error: (venv) root@Xue:/home/proyectos/FastAPI# uvicorn m

Render NumPy array in FastAPI

I have found return numpy array as image from fastapi but I am still struggling to show my image which just appears as a white square. I read an array into io.B

How to run FastAPI app on multiple ports?

I have a FastAPI application that I am running on port 30000 using Uvicorn programmatically. Now I want to run the same application on port 8443 too. The same a

How can I reduce the number of database queries for a one to many association in Strawberry GraphQL and FastAPI?

I'm developing a python GraphQL API server using FastAPI and Strawberry, and I'm implementing this feature: I have two entities, User and Order, which have a on

FastApi settings / dependency

I have a FastAPI app with pydantic settings instance reading and validation env variables: ### config.py from pydantic import BaseSettings class Settings(BaseSe

How to send and receive data in XML format using WebSockets and FastAPI?

I'm trying to communicate with a fingerprint device. Actaully it sends data through websocket connection. So, I think I can communicate with the device using we

How to test a dockerized application in an Azure DevOps (Server) pipeline?

I have a simple python dockerized application whose structure is /src - server.py - test_server.py Dockerfile requirements.txt in which the docker base image

How to render Streamable image on React coming from the FastAPI

I want to render a StreamingResponse image on React from FastAPI. The image is in the form of numpy array which is of cv2 type of object @app.post("/predict") a

FastAPI: reject a WebSocket connection with HTTP response

In a FastAPI based Web app, I have a WebSocket endpoint that should allow connections only if some conditions are met, otherwise it should return an HTTP 404 re

FastAPI variable query parameters

I am writing a Fast API server that accepts requests, checks if users are authorized and then redirects them to another URL if successful. I need to carry over

How to generate Pydantic model for multiple different objects

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:

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,

SQLAlchemy: JOIN between different databases AND using different files in a module

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