Python Forum

Full Version: Flask and Websockets == True?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

I was wondering what the best practice was for a Flask web app or API service with web sockets?

Maybe something like the below would be great!

@app.route("/")
def index_handler():
room = web_socket_connect()
return render_template("index.html", room)
(Apr-21-2019, 04:13 AM)rxndy Wrote: [ -> ]I was wondering what the best practice was for a Flask web app or API service with web sockets?
I would say using flask-socketIO can be looked at best practice.
So flask-socketIO is made to simplify the process of using of websockets in Flask.
Dude I will look into that!

Thanks! Dance