On 2020-10-01 16:33, sjeik_ap...@hotmail.com wrote:
Hi, I would like to create a "/reload" view in my Flask app, so I could easily and safely reload it when code, templates etc change. Similar to what happens when running the app with the debug server. I am using Nginx and Gevent on a recent Ubuntu system with Python 3.6. My strategy would be to gracefully stop Gevent [1], then do os.kill(os.getpid(), signal.SIGHUP). I have not yet tried this (not working today!). Just wondering if there are best practices. Thanks! Albert-Jan [1] http://www.gevent.org/api/gevent.baseserver.html#gevent.baseserver.BaseServer.stop
Running flask app.run(debug=True) will make the Flask server watching the filesystem for source code changes and re-deploy your app.
https://pythonhosted.org/Flask-Debug/ -Roland -- https://mail.python.org/mailman/listinfo/python-list