Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.15 KB

README.md

File metadata and controls

31 lines (22 loc) · 1.15 KB

What is this?

A very simple Turbo-Flask Python example. Turbo-Flask uses the HotWIRE JS (turbo.js) library to update sections/divs using WebSockets. As I am not particularly good with JS or front-end frameworks, I looked for a Python-based alternative. Turbo-Flask does the job: no need for tons of front-end JS code on the page - inspect the code and see for yourself. This app dispatches a thread that generates a random person's name every 3 seconds using Faker. Turbo-Flask automatically updates a div on the page with that random name. This code can be used by Python programmers as a reference template for Web-app projects that require async update from various threads.

Demo

Demo TurboFlask

Installation

Just satisfy requirements.txt; code tested with Python3 on Chrome

pip install -r requirements.txt

Usage

flask run

Contributing

Pull requests are welcome.

License

MIT