Skip to main content
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
2 votes
1 answer
97 views

The code works locally but when I put it on an EC2 machine and change the CORS origins accordingly it fails. I've checked the URL for 2 hours straight. I copied and pasted it from the page that loaded ...
CognizantApe's user avatar
  • 1,209
0 votes
0 answers
210 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
0 answers
108 views

I am working on a webapp which has these: FastAPI - Backend Chainlit - Frontend The chainlit frontend is mounted on the FastAPI backend. He is how it looks in the code: @app.get("/") async ...
Obiii's user avatar
  • 854
0 votes
1 answer
153 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
0 votes
1 answer
143 views

I'm trying to create a middleware, the logic of which depends on the response type. Specifically, I need to close the db session after the response has been sent for "immediate" response ...
Denis Shafarenko's user avatar
4 votes
2 answers
603 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
1 vote
1 answer
367 views

FastAPI profiler code if server_app is not None: server_app.add_event_handler("shutdown", self.get_profiler_result) I think Starlette is not allowing both lifespan and ...
serendipty01's user avatar
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
302 views

I have a FastAPI application that is behind a NextJS reverse proxy. I'm using NextJS rewrites, which sets the x-forwarded-for header to the externally-visible hostname and port. The rewrite looks ...
Tom's user avatar
  • 8,171
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
1 vote
1 answer
227 views

I have a (SQLAlchemy) User model as follows: class User(BaseModel): id: uuid: Mapped[UUID] = mapped_column(UUID, ...) I need to check if the user exists in DB for every request. I know I should ...
msln's user avatar
  • 1,563
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
0 answers
97 views

I am creating a web app that makes use of the amazon product advertising API. I haven't started on this part of the functionality as I am still creating the base web app. I have already created a ...
darkrai6666's user avatar
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

15 30 50 per page