Closed allsey87 closed 2 years ago
You can only use Flask-Sock with the supported web servers, all of which have a method of exposing the network socket. The web server that you are using is not in the supported list, so it cannot be used.
@miguelgrinberg would you be able to suggest a setup that includes flask-sock
and something akin to python-livereload
, i.e., something that causes the browser to reload when the source code has changed?
Flask in debug mode reloads on code changes. Isn't that sufficient?
As far as I am aware, it only reloads the server (not the browser).
Yes, only the server is reloaded, then you have to refresh the browser manually. I don't know of any solution that refreshes the browser as well, sorry.
Well, there is the heavy handed solution of bringing in Selenium (in conjunction with watchdog), but I was hoping for something a bit more elegant than that.
I have a frontend/backend set up that uses
flask-sock
and works well when I start my application with:However, when I try to start my application using the API of
python-livereload
as follows:I am getting the following back trace:
I am not sure how to interpret the error
Cannot obtain socket from WSGI environment
. As far as I understand, when I useflask run
, I am using the Werkzeug framework which is supported byflask-sock
and from the back tracepython-livereload
is using Tornado which perhaps is not supported?This is all a bit confusing since from #29 it is mentioned:
So I would have thought that it did not matter what underlying framework is being used...