55,038 questions
-2
votes
2
answers
137
views
Why does this work on windows but not mac? [closed]
I'm using flask to run a website, working across my personal imac (running macos 26) at home, and a windows PC (running win11) at college to code, storing all the code in github. I run app.py from the ...
0
votes
1
answer
76
views
Exceeded max user connections in python / flask / mysql
I am trying to run a Python / Flask / MySQL app but whenever I try to run it (using the command "python -m flask run"), it gives me this error:
mysql.connector.errors.ProgrammingError: 1226 ...
1
vote
2
answers
56
views
Flask redirect causes session details not modified
I am building a simple shopping cart using cookie sessions to keep track on the content of the shopping cart.
I just added a function that would remove single item from the list of items. But I ran ...
0
votes
0
answers
88
views
werkzeug.security log_in(user) returns error 404
When I try to log in my user and use check_password_hash() of Werkzeug security, I get 404 redirection link invalid. After adding the try and except clause it gets redirected to my except:
'tuple' ...
-4
votes
2
answers
83
views
CSS not being loaded in Flask WebFrame
I am building an banking application and I was just trying to link HTML using the Flask framework.
What I have done until now:
Clear all the cookies and Cache of the browser and run the code, Have ...
Best practices
0
votes
0
replies
93
views
How to optimize real-time image restoration performance in a Flask-based Deepfake defense system?
I am developing a system that integrates "Source Verifiable" and "Content Decipherable" into a single service workflow. The system uses Robust Watermarking to ensure source ...
Advice
1
vote
2
replies
117
views
Would it be a better idea to use celery?
I need some guidance on something I’m trying to implement. I’m accessing GPT-5.2 through the API, but the responses sometimes take up to 20–25 seconds. I’m concerned this could slow down the web app ...
0
votes
1
answer
88
views
Making a 2D data table in Flask/Python/SQLAlchemy
I am fairly new to Flask in python and I am putting together a webpage-based app to support a simple optioneering tool. I am saving the data from the web forms into a SQLite database using SQLAlchemy.
...
-1
votes
1
answer
48
views
fastapi mounted on flask on Digital Ocean App Platform issues
I have a flask app that I have mounted a fastapi app on so that my flask app is at / and the api is at /api/v1. Locally I serve this up on my windows machine using waitress and it works great. I ...
0
votes
1
answer
136
views
Getting 404 not found when I make a post request to flask + nginx
I am running a flask server on AWS EC2 instance. AWS EC2 instance means a computer on AWS. I use this command to run the server gunicorn --bind 0.0.0.0:5000 app:app. I have set up nginx as a reverse ...
-5
votes
2
answers
94
views
Possible to use query parameters in POST, PUT methods in Python Flask? [closed]
I am learning Flask framework, and when I learned about query parameters topics every one is teaching it with GET methods. So I am curious can we use query parameters for other methods also?
0
votes
1
answer
59
views
totalRecords count seems incorrect
My Flask application exposes a REST API for CVE data stored in SQLite. The API supports filtering and pagination, but is my totalRecords count logic correct when filters are applied?
totalRecords ...
0
votes
0
answers
84
views
Pyinstaller *.exe doesn't work while *.py works in pycharm (.venv)
from flask import Flask, render_template
import webbrowser
import threading
import time
import sys
import os
import traceback
def resource_path(relative_path):
if hasattr(sys, "_MEIPASS"...
0
votes
1
answer
153
views
Issues with Celery + Redis in Flask: Retry limit exceeded and Kombu connection errors
I'm refactoring a Flask application that receives video data along with some parameters. I decided to add Celery for controlled background processing and Redis to pass parameters. The workflow is:
...
Advice
1
vote
6
replies
79
views
How to use API to get and post data from different programming languages?
I want to develop some projects where I need to integrate some different programming languages. But I don't know how to set communication between them? Can you advice me that how can I learn to ...
Best practices
2
votes
0
replies
33
views
What are the security and feature checkpoints for considering an authentication system “complete” in a web application?
I’m building a web application and started with authentication, but I keep feeling it’s incomplete. In a professional production environment, what are the essential steps or criteria to ensure the ...
Advice
0
votes
1
replies
27
views
hosing Python / Flask apis in RHEL with heavy IO bound tasks
below is my application design. as ou can see my back end flask/ python apis are hositng websocket APIs for some of the front end actions. the intention is to have quick communication from front end ...
2
votes
1
answer
76
views
Custom FlaskWTF form errors not showing in template even with validate_on_submit()
I'm building a simple login form using FlaskWTF. The form renders correctly and submits, but the validation error messages (e.g., “This field is required”, “Invalid email”) never appear in the format ...
1
vote
2
answers
89
views
Why isn't this emitting the message?
@app.route('/3x3/online/<username>', methods = ['POST'])
def online3x3(username):
if username == session['username']:
socketio.emit('create', (session['username'], 1), namespace = '/...
0
votes
1
answer
162
views
ADK Google Gemini: "Session not found: default when" using InMemoryRunner with LlmAgent
I'm trying to use the Google ADK LLM agent (gemini-2.5-flash-lite) in a Flask project to check tests and review test content. I'm using InMemoryRunner and InMemorySessionService to run my agents.
Here'...
2
votes
2
answers
130
views
"TypeError: expected string or bytes-like object, got 'type'" error with SQLAlchemy query
(I'd tried to post this here, had someone post a version of it for me on r/flask, and am trying again here, so please excuse the duplication if the original one shows up.)
I'm trying to modify a Flask/...
1
vote
2
answers
90
views
How to pass database session through Flask context manager
I want to pass my database session through the Flask builtin context manager. Looking at the doc, it seems pretty straight forward.
Yet my sample fails on AttribueError: foo for HTTP and CLI calls:
...
0
votes
1
answer
76
views
How to use WTForms (.py package) to present information from database and modify it? [closed]
Context: I am trying to build a web application to manage employee information cards. So you can click on an employee card and view information like name, age, department etc. and then also modify the ...
-2
votes
2
answers
116
views
Incorrect IP when running app via Docker Compose [closed]
I have a python/flask app that I do docker build then docker compose. I am persistently getting the app running on IP 0.0.0.0. Here is output of docker compose up:-
Skipping DB seed: missing POSTGRES ...
0
votes
1
answer
88
views
Dash Plotly Flask Application randomly hangs for 1 minute
I have build a simple application with two pages (a multi-page Dash app) which I am running locally using Gunicorn with two workers and four threads. It's a simple dashboard application.
When I ...
-3
votes
2
answers
82
views
Flask publish on different local ip than the machine it deployed on inside a docker
I am using docker with a flask app inside to display the visual results in a browser.
I have created the image with the flask inside, tested on my machine (an Ubuntu 24.04 machine) and it seems to ...
2
votes
1
answer
207
views
Displayed data disappears after successfully adding data to sqlite database
Please help me! I'm building a simple stock search app using Flask (backend) and plain HTML/JS (frontend).
When the user enters a ticker, the app:
Send a GET request to my Flask backend (/search)
...
Advice
0
votes
1
replies
55
views
Using flask_moment to display a date in the web user's local format
I am learning from Miguel Grinberg's excellent Flask Mega-Tutorial and writing an app which tracks the items in two freezers. Dates are saved in UTC in the database but I want to display them in the ...
1
vote
1
answer
91
views
How to pass variables to a template HTML with Flask
i'm currently learning Flask templates, but i can't undestand how to pass a variable to it. Example of my Python code:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home():
...
0
votes
1
answer
70
views
Appropriate method to pass arguments in Flask without using the url
I am using flask and a deep learning model in tensorflow to display some annotated video. The module works fine but the loading of the model is lazy due to the nature of the generator. Only after I ...
0
votes
0
answers
76
views
Is there any way to fix type errors when overriding make_response?
I don't want to inherit from Response I want to use a pydantic model. I am doing this:
class AppResponse(BaseModel):
somefield: str
otherfield: int
class FlaskApp(Flask):
# Tried doing ...
0
votes
1
answer
38
views
Quart (Flask) file uploaded removed right after request completed
I'm using Quart (Flask fork) and I have a view which handles ".bin" file upload (100MB).
But on file.save(path) call I can see the file appears in destination folder for moment and ...
Best practices
0
votes
4
replies
105
views
Python: two Flask projects under the same HTTP Port
I have 2 separate projects running on the same Linux server. Both projects based on Flask. Due to infrastructure restrictions I'm able to use only one HTTP Port on the server.
I would like to route ...
1
vote
0
answers
53
views
Locust POST Request with .xlsx File to Flask Endpoint Returns a 503 Error
I am testing my Python Flask app using Locust to load-test a POST request with an .xlsx file attachment. However, I consistently encounter a 503 Service Unavailable error.
This issue ONLY occurs when ...
1
vote
0
answers
116
views
How can I use a return value in a flask endpoint from another flask endpoint?
I am currently working with flask endpoints that are connected to my react frontend. My return value for val is "null". Return data is 100% correct as it appears in my server log.
How can I ...
0
votes
0
answers
47
views
Nginx cutting off Flask streaming responses (with Docker) even with buffering disabled
I have a Flask backend running inside Docker, and it streams AI responses using a generator.
Locally it works perfectly, but after deploying with Nginx + Docker Compose, the streamed response gets cut ...
0
votes
0
answers
74
views
WebClient sending an empty multipart request to Flask service
I have a problem with sending multipart/form-data requests from my Java service (using WebClient but same history with RestTemplate) to Flask service. It seems like a sent body is just empty as I get ...
1
vote
1
answer
97
views
React/Axios file upload to Flask-RESTful gives 422 Unprocessable Entity
I'm trying to upload a file from my React frontend to a Flask-RESTful backend and I'm stuck on a 422 (UNPROCESSABLE ENTITY) error.
My backend logs show the POST request hits the right endpoint, but my ...
0
votes
0
answers
75
views
MongoDB Atlas Timeout After Deployment Update — "ReplicaSetNoPrimary"
I updated my backend deployment (Flask app) with a new feature not related to database logic, and suddenly MongoDB Atlas connections no longer work. Before the update, everything was fine.
Local ...
1
vote
1
answer
87
views
Serving js files from static folder in flask app with nginx and Docker
I have a strange issue with js files that cannot be found in a flask app, for which I use nginx in a docker container.
In the HTML template, I have this ref, using the url_for function
<script type=...
0
votes
0
answers
43
views
flask-scoketio: emitting from an external process without a message queue
I am developing a project using flask, flask-socketio, and the Multiprocessing python libraries.
My site runs on localhost (127.0.0.1:5000).
The goal is to update the html template every second from ...
0
votes
0
answers
39
views
I my flask app data store as json file when we refresh the page then all admin page data will disappear but store in the database fix this problem?
Frontend not connected to backend saving API
The “Save Application” buttons (like saveRegularApplication()) only push data into a JS array applications[] — they never send it to the backend /save-...
0
votes
1
answer
55
views
Import error on Flask CRUD App from import Modus from and url_decode
I am trying to develop a CRUD app using flask. The API is a simple REST API using add, update, delete and show.
from flask import Flask, render_template, redirect, url_for, request
from flask_modus ...
0
votes
0
answers
73
views
Intermittent ESC/POS Printer Issue Using Flask + Gunicorn on Raspberry Pi
I originally had a Raspberry Pi running Raspberry Pi OS (Full Desktop) with Apache serving a Flask app on port 80:
from flask import Flask, request
from escpos.printer import Usb
app = Flask(__name__)...
1
vote
0
answers
108
views
Memory Leak in Flask-SQLAlchemy 2.5.1 with SQLALCHEMY_RECORD_QUERIES - sqlalchemy_queries List Growing Indefinitely
Environment
Flask: 2.0.3
Flask-SQLAlchemy: 2.5.1
SQLAlchemy: 1.4.41
Deployment: Gunicorn with thread workers
Traffic: ~4 RPS in production
Observed Issue: Memory grows from 35-40% to 90% over 30 ...
0
votes
1
answer
120
views
javascript fetch and redirect through flask view not working as expected
In the html intro to a web app for a scientific study, data is collected through forms.
I added a javascript function that submits the data via the fetch API:
fetch('/prepare/', {
"method":...
1
vote
0
answers
56
views
WebSocket transcripts not received until connection is closed during Locust load test
I’m performing a WebSocket load test using Locust with websocket-client and a Flask webhook that receives transcripts.
The WebSocket connection works, audio chunks are sent correctly, and my backend ...
1
vote
0
answers
119
views
LinkedIn API: “ACCESS_DENIED - Field Value validation failed in REQUEST_BODY: Data Processing Exception while processing fields [/author]
I'm trying to post a job description to LinkedIn using their ugcPosts API through my Flask backend.
I’ve successfully obtained a 3-legged OAuth 2.0 access token with w_member_social scope.
Token works ...
0
votes
1
answer
106
views
Will file logging race conditions in multi-process Flask app crash the Python script?
I have a Flask application running on Gunicorn with 2 workers and 2 threads each (4 concurrent execution contexts). My custom logging function writes to a file without any process-level locking:
def ...
0
votes
1
answer
94
views
Does flask dev server normalize paths?
I was playing a CTF which was about path traversal. The server code was like below:
import flask
import os
app = flask.Flask(__name__)
@app.route("/docs/<path:path>", methods=["...