Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

Keycloak Middleware Issue: Empty preferred_username in get_user Object I'm using fastapi_keycloak_middleware to secure my FastAPI app with Keycloak. I'm having trouble mapping the preferred_username ...
Michael Meyer's user avatar
0 votes
0 answers
207 views

I'm trying to override the default exception handler in a FastAPI application so I can log any exceptions that happen. The problem that I run into is that my handler seems to run as it logs what I ...
bl4met's user avatar
  • 5
0 votes
1 answer
152 views

I'm implementing a FastAPI backend where I want to allow CORS requests only from a predefined list of default origins and dynamically loaded origins stored in the database. However, when the frontend ...
Rooban's user avatar
  • 197
4 votes
2 answers
601 views

I am developing a FastAPI app, and my goal is to record some information in a Request scope and then reuse this information later in log records. My idea was to use context vars to store the "...
ow-me's user avatar
  • 313
0 votes
1 answer
535 views

I am trying to run a websocket from a server where it watches a file and broadcasts any changes to the file over the websocket. This is my code: import os import json import uvicorn import asyncio ...
Ananda's user avatar
  • 106
1 vote
1 answer
72 views

I have a react nextJS project, and the following code: import axios from "axios"; import config from '@/app/settings/config'; import { configConsumerProps } from "antd/es/config-...
shijie xu's user avatar
  • 2,107
0 votes
0 answers
54 views

I have a CORS issue with this code from localhost:3000. I have checked the fastAPI documentation and add some code to tackle the issue. But there is no change and I have always the error. Here is my ...
EagleStar's user avatar
  • 209
0 votes
1 answer
154 views

I try to build a middleware for my app. I need a way to create some object in my middleware function and i want to have access to that object in a next endpoint method . Please see my code example . ...
Roman Gelembjuk's user avatar
1 vote
1 answer
326 views

I set up Session Middleware with my FastAPI backend to authenticate my React frontend users, which worked with domain=127.0.0.1. Now that I've deployed both my frontend and my backend to two separate ...
tprebenda's user avatar
  • 514
0 votes
0 answers
125 views

I'm trying to resolve Cross-Origin Request Blocked problem within my docker container. This is my FastAPI code: import os from contextlib import asynccontextmanager from fastapi import FastAPI from ...
Red_button's user avatar
0 votes
0 answers
131 views

I have a FastAPI server that creates a user session with the following code: @app.post("/session") async def create_session(req: reqs.LoginRequest, response: Response): session = uuid....
user104's user avatar
  • 125
0 votes
0 answers
153 views

I have deployed my FastAPI onto azure in a container, problem is after awhile I'm getting this error 2024-04-18T09:48:52.022078363Z: [INFO] fail: Middleware[0] 2024-04-18T09:48:52.022122364Z: [INFO] ...
John Doe's user avatar
2 votes
0 answers
1k views

I'm implementing custom exceptions in middleware and I want to raise an exception and expecting a JSON response with error message and code, when condition fails as mentioned below in middleware . But ...
Ayush Katiyar's user avatar
2 votes
0 answers
1k views

I am using FastAPI to build a python back end, which I deploy to AWS/Azure/etc. but also develop locally on. For the life of me I cannot figure out my cookies and CORS locally nor deployed and hosted ...
Matthew's user avatar
  • 73
0 votes
0 answers
257 views

How to pass a string starter from Azure http_trigger to the FastAPI endpoint? Currently I'm hacking this by setting starter in context.trace_context.attributes Or alternative to get the Azure bindings ...
André Ricardo's user avatar
0 votes
0 answers
318 views

there is this code: from fastapi import FastAPI, Request from fastapi.responses import JSONResponse app = FastAPI() @app.middleware("http") async def response_middleware(request: Request, ...
Zhihar's user avatar
  • 1,448
0 votes
1 answer
722 views

I am trying to send multiple files from UI to fastAPI in formData. But the API is throwing error instantly when the API's is triggered. async def createNewDirectory(files: Optional[List[UploadFile]...
Deep Kumar Singh's user avatar
0 votes
0 answers
260 views

Adding CORS to Python FastAPI Framework is giving this error error error serving tap http server: http: Server closed Configuration - def get_app() -> FastAPI: """ Returns ...
Akshay Hazari's user avatar
1 vote
0 answers
144 views

I am new to Python and FASTAPI. I would like to add custom middleware only to specific endpoints / path operations. Currently the middleware is getting executed for all the requests. I tried to filter ...
Vijay's user avatar
  • 33