In the home page of my website there’s a Materialize carousel with 3 slides. The page is a python flask template an the Materialize carousel is injected in the page, this is the base.html template And this is the home.html template containing the carousel and the slides: This is the Javascript that initialize the carousel: The problem is this: when
Tag: flask
Passing JSON data from Flask to JavaScript
I am trying to pass a JSON data from flask to JavaScript. The code I tried is from: Passing a JSON object from Flask to JavaScript The steps below are what I did : I first got my data from postgreSQL in Python I transformed the data format from DataFrame to JSON I modified @Ilya V. Schurov’s code And this
render_template does nothing after receiving ajax content (flask, python, javascript)
I am passing data with ajax to my python function when a condition is met: I know that the information is correctly received, since I can see it in the terminal through print: But python does nothing after the print() function. Render or redirect both don’t work, the browser stays just as it is even though the information was passed:
Server-Sent Events in Flask work locally but not on production (linode)
I’m trying to get a progress bar to work in Flask. I use a Server Sent Events for that. When I run it in local development server, then everything works well and I can see in the browser real time added numbers in /progress window and progress bar works no problems. But if I run it in Linux server (Linode),
convert wav file received in the request response to blob
I am trying to receive a WAV file as the response to a POST request. I use the send_file in Flask. I try to retrieve the file client-side in the response. I have ultimately converted it to a blob so it can be automatically downloaded. This is the API code for the server: This is the client script for the
Flask application redirects to empty “about:srcdoc” page when index (root path) is requested
I am working on a Flask web application. It has two iframes side-by-side and accesses a csv file. The file contains urls that, by using selenium .page_source(), will be loaded into the iframes using srcdoc. The page source is edited using beautiful soup 4 before being turned into a string and being sent to the frontend. The issue I am
store html checkbox value into list using flask, jinja2
I’m in need of some help. I am using flask and I have had an HTML page with a bunch of checkboxes. They are ordered as option1, option2, and option3 and then under the options, there are a number of boxes to check. I am trying to keep track of what all boxes have been checked for which option and
How to insert a JavaScript variable into Flask url_for() function?
I have following code in my Flask template: I want the link to render to: But I got this: How to make the js variable id in Flask url_for() function work? Thanks for your help! Answer Try this: url_for() will generate an URL like this: …/static/<filename>. If you use url_for(‘static’, filename=”), it generate an URL like: …/static/, so you can
Passing variables from Flask to JavaScript
I looked at similar forums but was not able to get any of the solutions to work. I am trying to pass variables from Flask to my JavaScript file. These values then will be used for PubNub from my JavaScript file. Here is part of my Python code: Here is part of my JavaScript code (app.js): this code works if
How to access formData in flask sent using websockets?Flask-SocketIO
How to access form data sent to Flask using web sockets? I receive invalid frame header in google chrome developer tools->console. Extract from my javascript code: How would I access, say ‘title’ field in my_form from flask ? request.form throws the same error “Invalid frame header” One more question, is it good to use web sockets for form submission and