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
3 views

Rotating file handler rolls over incorrectly, overwrites backups

I have a flask application functioning as an API. It's deployed on an NGINX server to 6 different ports. I have a remote log set up to a single location on a different server. It's using ...
1 vote
1 answer
44 views

Whitelisting URL endpoints to log in Flask API

I have a Flask API that is being flooded with request spam, so the log is full of nonsense. I want to whitelist the endpoints contained within the API to log requests. I have implemented a function ...
0 votes
1 answer
27 views

Why my join query in SQLAlchemy won't work with 4 filters

I am building a birthday reminder app and am working on the notifications bell in flask. When I open up the notifications it should populate with the user birthdays that the user follows that are ...
0 votes
0 answers
12 views

No such file or directory while running a python project using venv in windows operating system

I created a basic python project as practice just beginning to get around it using chatgpt tried running it using following commands C:\Users\Hello\Desktop\projects\1project180424>python -m venv ...
0 votes
0 answers
5 views

Flask SQLAlchemy SecureCookieSession Won't Persist Value

I am working on persisting user data to the Secure Cookie Session object whenever a user signs up or logs in. I noticed that I could set the session values in the login and signup routes, and those ...
0 votes
0 answers
7 views

SQLAlchemy "db.create_all()" command not adding Boolean column to my database table

I am working on a Flask project, I am trying to make a Database table to store Admin information using SQLAlchemy and PostgreSQL. Here is my code for the Admin Table. class AdminModel(db.Model): ...
0 votes
1 answer
9 views

Python Flask Sqlite is not creating a column in a specific line or name

This is just mind blowing I am trying to use in-memory table for small data that can be got easily but I dont want to send request all the time, so I save it in in-memory sqlite table here is my init....
0 votes
1 answer
30 views

"Missing 'aud' from claims" error when sending Web Push notifications with VAPID in Python

StackOverflow! I'm attempting to send Web Push notifications from my Flask application using the pywebpush and py_vapid libraries for authentication with VAPID keys, but I'm encountering an error ...
0 votes
2 answers
23 views

Python flask adding additional new lines to file while saving

While writing html textarea content in a file, python flask is adding additional new lines in the file. There is no issue while reading the content on textarea. Initial file content: line1 Line2 Line ...
0 votes
0 answers
19 views

Unable to use fastai load_learner() within Flask app

I'm getting this error when using the load_learner() in an api call Custom classes or functions exported with your `Learner` not available in namespace.\\Re-declare/import before loading:\n\tCan't get ...
0 votes
0 answers
24 views

how to make the function called when closing tab. Flask

I have a form and I want the user to be warned when closing the tab that the data will be lost. I figured out the modal window. Now I need to call it when closing a tab. I am not familiar with JS. Is ...
0 votes
0 answers
7 views

How would I improve my flask and html code in order to make the user stay in an account and the data to be secure in the database?

**Python flask imports** from flask import Flask, flash, redirect, render_template, request, session, abort, send_file import os import sqlite3 from os import urandom app = Flask(__name__) app....
-2 votes
0 answers
12 views

Live face detection using MTCNN

I wrote a code to implement MTCNN face detection but unfortunately it is very slow when I checked the fps it gives 2 max. Now I want to increase the speed of MTCNN to detect more efficiently. camera....
0 votes
0 answers
22 views

SQL Server Connection issues with Flask Web App

I have a python flask webapp and when the page is loading, connects to our SQL Server DB and saves certain tables as Panda data frames. This operation must happen as the page is loaded in. I am having ...
-6 votes
0 answers
35 views

Is it worth studying django in 2024 [closed]

I am a novice web developer and recently finished learning python, now I want to move on and try to make the first real project with a working backend. After reading about different frameworks, I ...
0 votes
1 answer
23 views

OperationalError sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: user

I am working flask and I want to create a database to store my user input. It's been hours now and I'm still getting this error. I made sure my db was created and imported corrected, I also tried db....
-2 votes
0 answers
19 views

why i am getting this error An error occurred while updating the password. Please try again.for updating password solve this error [closed]

An error occurred while updating the password. Please try again. i am trying to update password when i am click forgot password link in the login page .but create new password page not updated ...
0 votes
1 answer
14 views

How to solve problem with psycopg2 on Docker?

I have an application image that I am trying to run from Docker with the command docker run -p 5000:5000 api Every time I try to run it gets an error 'File "/usr/local/lib/python3.8/site-packages/...
0 votes
1 answer
25 views

How to make "Show More" button with Flask and Javascript?

I have one array of items and I want to display then in a unordered list. First I want to just show a few of these and after I press the button "Show More", the others items get displayed on ...
0 votes
1 answer
18 views

ImportError: cannot import name '_request_ctx_stack' from 'flask'

I am new to Python and flask framework when I am using flask I am getting "ImportError: cannot import name '_request_ctx_stack' from flask I have tried executing the following commands pip ...
0 votes
0 answers
15 views

UnimplementedError tensorflow.python.framework.errors_impl.UnimplementedError: Graph execution error when try to predict using deep learning model

I have trained my deep learning model and saved it with the name "try_model_in_out.h5", then I want to try to create a website that can receive input and use the model I have trained to ...
0 votes
0 answers
19 views

Encountering CORS Errors When Calling Flask Sending File API from Browser, But It Works in Postman

I am developing a Flask application and have implemented CORS support. Everything works fine when I test my API using Postman. However, when I attempt to make requests via a browser, I encounter CORS ...
19 votes
11 answers
32k views

Flask not activating debug mode

I am getting started with flask, I am trying to follow some tutorials, but I have been unable to run Flask app in debug mode. I tried the simplest code I found: from flask import Flask app = Flask(...
0 votes
1 answer
16 views

Python flask register page

@app.route("/register.html", methods=['POST', 'GET']) def register(): if request.method == "POST": firstName = request.form['firstName'] email = request.form['...
0 votes
0 answers
15 views

Issue with session and object relationships extracting all data from a table instead of just one element

I've been trying all possible solutions suggested by chatgpt and what I could find on the web but nothing worked, and I think it's beyond my understanding of Python/Flask/SQLAlchemy. I attempt to link ...
0 votes
0 answers
13 views

How make "Show More" button with Javascript and Flask For Loop in tables

I'm building an application for student consultation. In the admin tab I show the students who are registered through a table. However, I don't want to display them all at once, because that will make ...
3 votes
2 answers
75 views

Issue linking CSS to HTML file

I can't figure out how to link a CSS file to my HTML file. I'm am using Visual Studio Code, Python, and Flask to do this My project directory is like this: - templates - home.html - style.css - ...
0 votes
0 answers
7 views

Error : X does not have valid feature names but SVC was fitted with feature names

print("predicted disease :",svc.predict(X_test.iloc[0].values.reshape(1,-1))) print("Actual Disease :", y_test[0]) i am getting : UserWarning: X does not have valid feature names, ...
0 votes
0 answers
18 views

Flask REST API cannot connect to MySQL db docker containers [closed]

I need some assistance in solving the issue considering my Flask REST API. I have a simple API that is imitating the behaviour of real time web analytics API, it is still not finished i made a core of ...
0 votes
1 answer
23 views

routing a view through blueprint in another module doesn't work

I have a flask project with following three files: # app.py from flask import Flask from userbp import bp app = Flask(__name__) app.register_blueprint(bp) @app.route("/") def index(): ...
0 votes
0 answers
7 views

How to deploy a PostgreSQL database for Flask App on Vercel?

I deployed my Flask App on Vercel. But I can't find any StakOverflow answers or YouTube tutorials on how to connect my PostgreSQL database to the app on Vercel. I am reading the documentation but it ...
0 votes
1 answer
752 views

Responsive items not working in Flask local web server

I'm developing a Flask webApp in which I have included some responsive items. For example, the navbar is hided in small screens and replaced with an icon which opens a lateral bar, and the elements ...
0 votes
0 answers
11 views

flask migrate don't create new models and even db.create_all() and db.drop_all() work only on 2 tables and not all the tables

i create a simple app with flask login and blueprints and then try to start and try adding new tables and relationships to the data base, it work at first and every thing were just fine but then i ...
0 votes
1 answer
21 views

504 Error When Sending Requests to Flask RESTful Resources on PythonAnywhere

Hey I have a flask app and I am trying to host it on pythonanywhere. The app is running and I can visit the homepage at https://<my-username>.pythonanywhere.com. But when a user tries to log in ...
0 votes
0 answers
12 views

How can I correctly define routes in nginx for a flask app?

I am using nginx as a reverse proxy for my simple flask app. I start gunicorn and after that start nginx to proxy it. Here is the code of my flask app: from flask import Flask, render_template from ...
-3 votes
0 answers
13 views

Build REST API with Flask [closed]

I'm trying to build a REST API using Flask. I've seen two methods, one using only Flask and the other uses Flask-RESTful. Is there a difference? I tried two meethods and I think the one with only ...
0 votes
0 answers
16 views

Flask in PythonAnywhere. Returning unexpected HTML page

Iam trying to use flask to build a web app hosted by pythonanywhere. When iam a sub html page (accessed by pressing a button) I get transported to a page where I can make a POST request using the ...
0 votes
0 answers
18 views

ModuleNotFoundError: No module named 'flask' VS code

I have the following code: from flask import Flask, render_template app = Flask("website") @app.route("/") def home(): return render_template("index.html") app.run(...
15 votes
12 answers
34k views

ModuleNotFoundError: No module named 'flask_session'

I have a simple python file that I am trying to set up to utilize sessions, when i run the file I am receiving the error below: ModuleNotFoundError: No module named 'flask_session' I believe I am ...
1 vote
0 answers
32 views

Flask is page can not be visted outside of container but works inside (using curl to test in container)

I have a Python Flask application running in a docker container, I try to access it from the localhost using cURL, the error returned is curl: (56) Recv failure: Connection reset by peer, when I use ...
1 vote
1 answer
25 views

CORS Policy Error When Making POST Request from React App to Flask Server

I have developed a chatbot using a Flask backend and a React frontend. When I try to send data from my React app (running on localhost:3000) to my Flask backend (running on localhost:5000), I ...
0 votes
0 answers
12 views

When running Flask I get an import error from a module

I currently have a virtual environment created with python -m venv venv I pip installed Flask and pypco. When I run the following Flask server with flask run: from flask import Flask import os import ...
0 votes
0 answers
19 views

Error: The certificate for this server is invalid

I am creating an Outlook add-in locally. The react application for the UI makes an api call to a locally deployed flask app for some data. But the react app is never able to get the data from the ...
0 votes
0 answers
16 views

flask pod do not scale well with k8s pod [closed]

Context: I have a k8s cluster of three nodes with config: Ubuntu22.04, Intel, 4CPU, 8GB memory, on a oracle cloud. I use locust to perform load testing on a node port service with backend: deployment ...
0 votes
1 answer
22 views

how to import a file from a package that requires another package within its own folder to run

revitalize/ ├── app.py ├── static/ ├── templates/ ├── GFPGAN/ │ ├── experiments/ │ ├── gfpgan/ │ ├── inputs/ │ ├── results/ │ └── inference_gfpgan.py └── DeOldify/ ├── deoldify/ ├── ...
0 votes
0 answers
21 views

Not a valid choice for Flask WTForms SelectField

enter image description here This is my Form Class: class ProfileForm(FlaskForm): login = StringField("Login", validators=[DataRequired()]) bday = DateField("Birthday", ...
-3 votes
0 answers
13 views

y contains previously unseen labels: '137' [duplicate]

I am getting this error in my flask app and haven't been able to solve it. Below is the code for my model: # Importing Libraies import numpy as np import pandas as pd import lightgbm as lgb from ...
0 votes
1 answer
29 views

Swagger Codegen: ModuleNotFoundError: No module named 'connexion.apps.flask_app'

In my app I upgraded connexion (2.14.2=>3.0.6), flask (2.2.5=>3.0.3) and werkzeug (2.2.3=>3.0.2) and of course all required/depending libs. I use the SwaggerHub to generate a Python client ...
1 vote
0 answers
21 views

No such table: cafe | startup page not loading after user names cafe

The database creates as I see the file "data.sqlite" but the startup page isn't loading after the user enters the name of the cafe. In fact, it redirects the user to /nameCafe after naming ...
0 votes
0 answers
18 views

Running Local LLMs in Production and handling multiple requests

I am trying to run a RAG with Gemma LLM locally it is running fine but the idea is I can't handle more than one request at a time. Is there a way to handle concurrent requests with utilizing resources ...

1
2 3 4 5
1114