Skip to content
Advertisement

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”,

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

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

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

Advertisement