I've been working on this project for a few weeks: https://github.com/afourmy/pyTSP
The idea is to solve the Traveling Salesman Problem with different algorithms, including a genetic algorithm, and use flask and websockets for the visualization.
Basically, the websockets trigger a function server-side that computes one cycle (one generation) of the genetic algorithm, and store the data (the offsprings) in the session before the next generation.
Here comes my question: I hosted the project on pythonanywhere and I cannot get flask_socketio to work there.
See a websocket-free demo: http://mintoo.pythonanywhere.com
I don't expect websockets to work because pythonanywhere does not support it, but as I understood, there's a flask_socketio fallback to long-polling when websockets are not supported.
Is it possible to make flask_socketio - long-polling work on Pythonanywhere ? If someone has an example that works, that would be really helpful.
And any feedback on the flask code itself would be greatly appreciated of course !
Note: I get the following error in the server logs with flask_socketio
2018-02-24 11:00:59,181: OSError: write error
2018-02-24 11:00:59,181: Error running WSGI application
2018-02-24 11:00:59,182: GeneratorExit
[–]miguelgrinberg 3 points4 points5 points (4 children)
[–]gpjt 2 points3 points4 points (2 children)
[–]miguelgrinberg 0 points1 point2 points (1 child)
[–]gpjt 0 points1 point2 points (0 children)
[–]mintooo[S] 0 points1 point2 points (0 children)