This is an example of how to use the jQuery $.ajax methods to send JSON data to a Python Flask route.
$ virtualenv ajax-flask-demo-env
$ source ajax-flask-demo-env/bin/activate
(ajax-flask-demo-env) $ pip install -r requirements.txt
(ajax-flask-demo-env) $ python app.py
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit
* Restarting with stat
* Debugger is active!