I am trying to build a chat app using Flask-socketio, where clubs can have their members talk to each other. The app differentiates the chats of different clubs using arguments in the URL, as shown in the “/chat/<club_code>” route. However, the socketio connection is updating both chats with the messages of both clubs (club1 and club2). How do I make
Tag: flask
Inserting a request.form.items() list into a mongodb collection / Adding list of lists into mongoDB
I have the following code: I use for x in request.form.items() to loop through a dynamically generated form. Users create custom fields that can be added. I then add the results to a list of which an example of a print out is: [(‘name’, ‘David’), (‘phone’, ’90’), (’email’, ‘inf’), (‘company’, ‘Ran’), (‘Kids Names’, ‘Kids Names’), (‘Kids Birthday’, ‘2022-08-03’), (“Wife’s Email”,
Difference between included SQLite3 library in Python and SQLAlchemy [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 7 months ago. Improve this question I know there is an included library in python for SQLite3, and when I was studying Flask the course instructor
Convert Date in JavaScript (from a Python Dataset)
How do I edit the date format that gets returned from a dataset from Python via a Flask App in Javascript? It currently shows up as datetime, but I want it to show up as a custom date format. The best type of answer would help me to understand how to access those date values and create a custom date,
Minimal Flask app unreachable from Docker container
I have a very simple flask service that I’m trying to run inside a docker container. I used python to implement a minimal application that is working fine on my Windows, but isn’t reachable when inside a Docker container. I tried the common fix of setting –host=0.0.0.0 (tried multiple ways), but it did not solve my problem. Project structure: ├──
Synchronization for video/audio/text message in flask web app framework for facial emotion recognition
I have trained a CNN model in Google Colab for facial expression detection with the FER2013 dataset containing 7 emotion classes (‘Angry’, ‘Disgust’, ‘Fear’, ‘Happy’, ‘Sad’, ‘Surprise’, ‘Neutral’). Used flask framework to build a web application. OpenCV’s haarcascade_frontalface_default.xml is used to detect faces. With this I’m able to do real-time live streaming of the video using my laptop’s webcam and
API Requests for Multiple Forms Returns 400 Error on Python Flask
I’m building a recipes website that collects data from Spoonacular’s API. The user can search by Recipe, by Ingredients or by Nutrients. The search works if I only have one if condition and comment the others. But when I uncomment the others, only the first one will work. The above code returns a 400 Bad Request error on the Ingredients
Load data from Flask/Python to HTML textarea
I am trying to send data from Python / Flask to an HTML form textarea but need some help. responses.html is shown below. A portion of app.py is shown below: I would like to display any previously recorded responses in the response textarea of responses.html while preserving the placeholder when no previous response was received from the user. Answer I
AttributeError: module ‘jinja2.ext’ has no attribute ‘autoescape’ while trying to use Flask-Babel
I am new to Flask and Babel and I have just started a project which will contain several languages. After I have generated the babel.cfg file, when I attempt to extract it with the command pybabel extract -F babel.cfg -o messages.pot ., I get the AttributeError: module ‘jinja2.ext’ has no attribute ‘autoescape’ error. What can be the reason for this
How to fix IntegrityError: (psycopg2.errors.ForeignKeyViolation) update or delete on table “users” violates foreign key constraint
I have two tables created with Flask-SQLAlchemy below – they have a one to one relationship. I would like to update the user table in a case when the user would like to have a new username: The db.session.commit throws the following error: The error says the logo table still has the old username but I have updated it and