How to stop flask application without using ctrl-c,app.run()