55,177 questions
3
votes
2
answers
106
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)
...
-4
votes
0
answers
91
views
Unable to pass variables to HTML using Flask [closed]
I'm trying to set up a webpage using Flask so I can pass Python variables to the HTML page. I created a test Python file with a page.html file inside a templates folder. I used the render_template ...
Advice
0
votes
1
replies
38
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 ...
2
votes
1
answer
69
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
60
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
52
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
28
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
87
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 ...
0
votes
0
answers
60
views
send bulk mail in flask through 4 deferent deferent mails domain server
import os
import re
import time
from datetime import datetime
from smtplib import SMTPRecipientsRefused
import pandas as pd
from celery import Celery
from celery.schedules import crontab
from flask ...
1
vote
0
answers
39
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
92
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
37
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
63
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
0
answers
61
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
59
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 ...