Questions tagged [flask]

Flask is a lightweight framework for developing web applications using Python.

flask
Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

error accessing the api with flask, either through the get or post method

I want to access a python api with sending parameters, namely an image file. I always get the same error, 404, whatever the parameter I'm sending, images, text or even an int. how can i solve? file ...
Pedro Gonçalves's user avatar
7 votes
3 answers
5k views

TypeError: issubclass() arg 1 must be a class when importing langchain in Flask

I am doing a microservice with a document loader, and the app can't launch at the import level, when trying to import langchain's UnstructuredMarkdownLoader $ flask --app main run --debug Traceback (...
prout's user avatar
  • 357
0 votes
0 answers
22 views

Why am I getting a bad request error when uploading files using flask?

How do get a file from a form and store it in a database from werkzeug.utils import secure_filename app.config['UPLOAD_FILE'] = r'C:/Users/ujesh/OneDrive/VS CODE/YE/feed' @app.route("/upload&...
Ujesh Sakariya's user avatar
1 vote
0 answers
148 views

Flask JWT Extended module not found error

Module import error 'flask.typing' when trying to import from Flask-JWT-Extended. Tried running below command after doing, pip install Flask-JWT-Extended from flask_jwt_extended import JWTManager, ...
Vaibbhav Devender Kalra's user avatar
3 votes
1 answer
2k views

Unable to send OpenAI stream response via Flask API

For streaming OpenAI response in langchain I use this https://python.langchain.com/en/latest/modules/models/chat/examples/streaming.html It streams the response in my terminal. I want to send stream ...
Syed Mujeeb H's user avatar
0 votes
0 answers
168 views

How do I send an email during stripe payment after a purchase in python? Why is my example not working?

I am trying to send the email with the code from here in python. https://stripe.com/docs/receipts I added it in the code below. The problem is the email isn't getting the email. I based the code on ...
trewbth's user avatar
  • 15
0 votes
1 answer
75 views

Why does my Flask app search results page need to be reloaded to display results only when served by nginx?

I have set up a flask-based site that takes user input and makes a query to a postgres database. It works great when I run the app locally, but when I take it live on my vps, the search results in an ...
Logos Masters's user avatar
0 votes
1 answer
27 views

Is there a way to reflect current state of many-to-many relationship in a form of multiple checkbox fields?

Is there a way to reflect current state of many-to-many relationship on multiple choice field checkboxes? given working many to many relationship between Song and Tag tables. here is the layout: ...
Gregoriy Kim's user avatar
0 votes
0 answers
37 views

How to import pandas df as variable into html

I am using flask to write an app that displays a pandas df on part of a webpage. Here is my html template: <!--user_input.html--> <html> <body> <form action="&...
connor449's user avatar
  • 1,599
0 votes
0 answers
30 views

Flask application - how to get checkbox status?

I'm trying to learn flask with small app for saving data from Pandas DataFrame into json file - and I have problem with this save part... I tried many approaches, but can't understand what I'm doing ...
Łukasz Kudelski's user avatar
0 votes
1 answer
287 views

Import error: Flask not resolved in Python test with Visual Studio Code

I do not understand why it shows that the flask is not imported. I checked my terminal and it says that is has been. What am I doing wrong? this is what I am trying to runthis is me chekcing my flask ...
Jenny Li's user avatar
1 vote
1 answer
117 views

Python Flask, display an image stored as a binary blob in MySQL database

I'm trying to display an image that is stored in a LONGBLOB column in a MySQL database, using Flask: app.py: @app.route('/get_image', methods=['GET']) def get_image(): args = request.args ...
parsecer's user avatar
  • 5,014
0 votes
0 answers
153 views

Python Flask Mail - ConnectionRefusedError: [Errno 61] Connection refused

I am creating a second python application and I am using flask-mail with gmail. For some reasons, I am getting an error while my 1st application which I did some months back works even after I ran it ...
akiols's user avatar
  • 1
0 votes
1 answer
50 views

Including refresh token in tmp folder using Google App Engine problem

I lanunched a flask app on Google App Engine that uses google sheets API. I am having problem with acessing my refresh token located in tmp directory. auth code looks like this: def access_sheet(): ...
Piotrek's user avatar
  • 13
0 votes
0 answers
276 views

Unable to deploy Dash App within Flask App using gunicorn: gunicorn vs flask run

I am trying to deploy a dashapp as a page within my flask application, using gunicorn. My setup works just fine when running flask in development mode, but when I run the application using gunicorn I ...
Felix Hernandez Ansuategui's user avatar
0 votes
0 answers
70 views

Gunicorn logging differs from flask logging

flask and gunicorn are not generating the same log messages. Many INFO log messages generated when using flask are not generated by gunicorn. Why, and how is this fixed? These two examples handle the ...
Arthur's user avatar
  • 565
0 votes
1 answer
82 views

Flask-React.js setup issue: fetching JSON from backend results in error, response.json()

I am new to React.js and Flask and am creating a basic app following an outdated tutorial. My github repo is: https://github.com/CadeHarger/flaskdemo. I am in the process of establishing a frontend-...
Cade Harger's user avatar
0 votes
1 answer
1k views

DPY-4011: the database or network closed connection

I use flask 2.2.2, gunicorn 20.1.0, sqlalchemy 2.0.13 without Flask-SQLAlchemy and oracledb 1.3.1. I have two scemas and two engines each for their own schema because they need different users to ...
Артем Котов's user avatar
0 votes
0 answers
25 views

Why am I not able to pass two status Ids in my GET method?

I have a scenario where in I need to compare two simulation coming from same table, i.e say simulation_1 and simulation_2. For all completed simulation theer would be a unique id generated "...
user3521180's user avatar
  • 1,110
0 votes
0 answers
55 views

How can I fetch 2D array from HTML frontend to the flask end?

import numpy as np # Example input data input_data = [[3758096389, 0, 114456999, 0, 0, 0, 2601295.432, 10001143, 2601295.432, 10001143, 1, 0, 0.393160754, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0]] # ...
Swami Mahale's user avatar
0 votes
0 answers
82 views

When storing an image in an S3 bucket, nginx displays a 502 Bad Gateway error

I can store images in a bucket on a local host and retrieve them. the bucket is open to the public. The secret key and access ID for AWS are correctly configured. Ngnix serves bad gateway errors and ...
LOKESH R's user avatar
0 votes
0 answers
24 views

File Storage for Web Applications during production

Which form of file system SQL, NoSQL, the cloud, or a static/subdirectory inside the application should I use for my web application? sql: I've tried to save the images as blobs, but I can't get them ...
LOKESH R's user avatar
1 vote
0 answers
20 views

How to correctly pass the data array to the server and to the download link?

I need to implement the ability to download an unload from a database in xlsx format. The user can choose which columns to unload (columns variable) and use a filter on several columns - variables: ...
Di Atr's user avatar
  • 11
-1 votes
1 answer
70 views

How to fix Github pages not recognizing files [duplicate]

Why aren't my files working correctly when I upload them into GitHub? They work fine in the IDE with local flask. Although the files only worked in visual code if the structure is something like this. ...
noctis's user avatar
  • 1
0 votes
3 answers
2k views

How to fix TypeError: insert expected 2 arguments, got 1 in Python Flask?

TypeError: insert expected 2 arguments, got 1 so, when i got objects in fuction get, and then i want that value in my dataUser, ive old list (output) [{ 'username':'budi'},{ 'username':'jhon'}] and i ...
Wildy Simanjuntak's user avatar
0 votes
0 answers
22 views

Read JPG using Flask after being uploaded without being saved on the server

I'm new to HTML, CSS and JavaScript. I'm doing a website where the user uploads an image in a drag and drop container. I want to read the uploaded JPG file using Flask once a POST request have been ...
EduHG's user avatar
  • 31
0 votes
0 answers
140 views

How to change flask location to work in more than one local path?

I am using VScode I installed flask in the /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11 as shown trough pip show flask. My problem is it is only working in the local path usr/...
Merlin's user avatar
  • 1
0 votes
1 answer
1k views

Unable to install Greenlet for Flask-sqlalchemy

I am trying to install greenlet for flask-sqlalchemy but I am getting error all the times. I also tried by downloading the file and install into the virtual environment created, but no progress with ...
Supayan Das's user avatar
0 votes
0 answers
143 views

Why running pip install -U Flask results in cannot import name 'parse_rule' from 'werkzeug.routing' error?

After running pip install -U Flask, is successfully installed Flask-2.3.2 and Werkzeug-2.3.4. After this came the cannot import name 'parse_rule' from 'werkzeug.routing' error. When searching online, ...
realPro's user avatar
  • 1,721
0 votes
0 answers
82 views

Data Visualiztion Using Java Sockets and Flask Python and Cytoscape.js dagre

i am trying to visualize DAG graph data through java Sockets (Server-Client) i used Flask to create a web Application . The Client Should is sending the DAG graph data to the server and the server ...
user16009254's user avatar
0 votes
0 answers
415 views

unable to open database file for sqlite3 in my Flask app

I have a Flask app where I call sqlite3.connect('database.db'). This causes the error: sqlite3.OperationalError: unable to open database file. This seems to work fine when testing on Windows but not ...
Lacey's user avatar
  • 23
2 votes
1 answer
160 views

Problems while operating with a database in SQLAlchemy in a Flask website

I had a fully working flask application with a register and login forms that were linked to the database. Next I decided to add one more column to the table named user in the database and I named it ...
LStep's user avatar
  • 87
0 votes
0 answers
34 views

Flask for Python with MySQL

After my program can detect the relevant objects, it successfully grabs the information of the database and displays it on the web, but I don’t know why AttributeError: 'tuple' object has no ...
TanNeil's user avatar
0 votes
0 answers
567 views

Playwright-Python Script on Ubuntu 22.04 with Flask + Gunicorn. Playwright Error Exception('Connection closed while reading from the driver')

I have a Flask App that has a route that triggers a Playwright script install on ubuntu 22.04 with ngnix. However, the playwright script does not seem to trigger as it keep getting the error. ...
Suren Gunaseelan's user avatar
0 votes
1 answer
55 views

DigestAuth using dart getting 401

I have been trying to figure out Digest authentication in dart. Whatever I do the server is returning 401 Unauthorized. Following is the code I used to login. I am using http_auth library. final url = ...
Alen Paul Varghese's user avatar
0 votes
0 answers
397 views

Error installing flask-sqlalchemy "Could not build wheels for greenlet..."

New to Flask, trying to install Flask-SQLAlchemy "pip install flask Flask-SQLAlchemy". Getting error building wheel for greenlet: error: subprocess-exited-with-error × python setup.py ...
Kevin T's user avatar
  • 45
0 votes
0 answers
43 views

No transcription is showing on console Twilio and flask

I am trying to build a system where the user will call on my Twilio number and user will speak after the user speak system will transcript it and paste it on console, below is the code which i have ...
Siyam Fahad's user avatar
0 votes
1 answer
293 views

What is the correct way to run a Python Flask API on Docker with Miniconda and access it on localhost?

How to access Flask API running on localhost docker container? I created miniconda docker image with Flask API on it. Dockerfile is: FROM continuumio/miniconda3 # Install base utilities RUN apt-get ...
Roman Velichkin's user avatar
1 vote
1 answer
125 views

Serial Read thread not running while flask thread is running python

I am trying to read serial data on a raspberry pi and display it on a webpage within a Flask server The issue that I am having is that when I run the code with both threads started, the thread that is ...
kaydrae's user avatar
  • 133
3 votes
1 answer
6k views

Benchmarks of FastAPI vs async Flask?

I'm a developer without an interest in benchmarking and I'm trying to decide whether I should use Flask or FastAPI to build some Python/Vue projects. I'm seeing stuff online about how FastAPI was ...
Nathan Wailes's user avatar
0 votes
0 answers
22 views

Only the first page works after configuring Flask with uWSGI and nginx - what's causing the redirection 404s?

Flask uWSGI nginx redirections problems error 404 I have configured the server like this https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uswgi-and-nginx-on-ubuntu-...
Antonin Graisset-Recco's user avatar
0 votes
1 answer
92 views

Can't update a record using flask-restx sqlalchemy mariadb v10.5.20 "(mariadb.NotSupportedError) Data type 'tuple'"

github repository This is a simple REST API, have 2 classes Client, Product. Relationship: A client can have many products, Client 1---* Product. I can list, create, search by id, with the 2 models, ...
christianbueno.1's user avatar
0 votes
0 answers
68 views

printing in dockered flask-mqtt app only sometimes reaches docker logs

I have a flask-mqtt app. This app recives a webhook and then sends a message to a mosquitto broker. The flask app, the software triggering the webhook (directus) and the mosquitto server are running ...
BranAndSceolan's user avatar
0 votes
1 answer
73 views

How to implement WSGI while using multiprocessing in flask?

Suppose I have video process handler in a function, I want implement true parallel processing using multiprocessing module instead of threading. So my code looks like this in general: def ...
Muhammad Ikhwan Perwira's user avatar
0 votes
0 answers
37 views

Heroku deploy detectron2 could not find a version

i'm trying to deploy my python flask app to heroku. when i'm pushing to repository to heroku that's occurs remote: ERROR: Could not find a version that satisfies the requirement detectron2==0....
bart's user avatar
  • 81
0 votes
0 answers
17 views

How can I return scraped information from my scrapy spider to my Flask server?

I want to call my scraper from my flask server and have the value returned to the server. At the moment I am using subprocess to call the scraper, and a POST request to send the scraped information. ...
Calvinism's user avatar
2 votes
1 answer
52 views

Python project not importing a local module

I have a python project using Flask and I have a form I have setup in a module I called forms. I test my app in Windows and it works just fine. I then update my project on Debian where I use Apache2 ...
Lacey's user avatar
  • 23
0 votes
1 answer
207 views

python dict to json and sending to HTML using Flask

I need to print a big python dictionary in HTML with neat format to read using Flask. Lets take this dict as example: a={'a':True, 'b':False} a_json=json.dumps(a) # {"a": true, "b":...
Vishak Raj's user avatar
0 votes
0 answers
68 views

Media Pipe Code Working Fine in Python Editor but does'nt draw landmarks in react after API integration

Problem: My code is working fine in Pycharm Editor. but I want to run it in my expo react native app Therefore I have created an API for it which does not draw landmarks inside react native. I have ...
Junaid Ahmed's user avatar
0 votes
0 answers
34 views

Visual code No detect my variables of WTForms Flask

My visual code does not detect my variable of WTForm of Flask Forms, it was working all ok, but 2 days ago I have this problem, in this example my Flask form variable are: form.nombres.data; visual ...
LUIS BENALCAZAR's user avatar

1
79 80
81
82 83
1113