Skip to content

Tag: python

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 send audio blob from javascript to python?

I want to send a audio blob from JS to python script (which runs on server). My JS ajax .. looks something like this. and my python script looks like this. Right now, I am just testing, so it should get me the duration of the audio file. The blob is generated through record.js This is not working, as the

Solve Cross Origin Resource Sharing with Flask

For the following ajax post request for Flask (how can I use data posted from ajax in flask?): I get a Cross Origin Resource Sharing (CORS) error: I tried solving it in the two following ways, but none seems to work. Using Flask-CORS This is a Flask extension for handling CORS that should make cross-origin AJ…

How to achieve realtime updates on my website (with Flask)?

I am using Flask and I want to show the user how many visits that he has on his website in realtime. Currently, I think a way is to, create an infinite loop which has some delay after every iteration and which makes an ajax request getting the current number of visits. I have also heard about node.js however …