I am writing a python / flask application and would like to add server reboot functionality.
I am currently starting the server with the following option
app.run(debug=True)
which leads to the following: every time a code change occurs
* Running on http:
* Restarting with reloader
However, in a production environment, I would rather not install debug=True, but be able to restart the application server whenever I need.
I am trying to get two things to work:
if reload_needed: reload_server() and- If the user clicks the "Server Restart" button on the admin panel, the function should be called
reload_server().
However, despite the fact that the server reboots after changing the code, I could not find a function that allows me to do just that.
, flask/werkzeug. , - , , gunicorn/nginx/apache ..