kf106 / async_flask_2

Asynchronous flask application pushing data to a web page

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Asynchronous data-push using Flask-SocketIO

Example of asynchronous flask communication with web page. It can be used as a template for producting Python 3.5 applications that use a web page for monitoring live datastreams.

This repository is a sample flask application that updates a webpage using a background thread for all users connected, by outputting a new random number every 5s.

It is based on the very useful Flask-SocketIO code from Miguel Grinberg, and does the same as Shane Lynn's async_flask demo, but for Python 3.5.

https://github.com/miguelgrinberg/Flask-SocketIO

https://github.com/shanealynn/async_flask/

To use - please clone the repository and then set up your virtual environment using the requirements.txt file with pip and venv. You can achieve this automatically with:

./install.sh

Switch to the virtual environment and start the application with:

./run.sh

Visit http://localhost:5000 to see the updating numbers.

About

Asynchronous flask application pushing data to a web page

License:Other


Languages

Language:HTML 47.9%Language:Python 27.0%Language:Shell 15.7%Language:Batchfile 9.4%