Shutdown Flask (Local Development)

To stop a running flask application in the CLI, you can just simply press ctrl + c. But sometimes this doesnโ€™t work and the work around is to get the process id of flask and use the kill command. But there is another way of addresssing this using a python function. Just simply add this script to your flask application and invoke the /shutdown endpoint. The code from flask import request def shutdown_server(): func = request....

February 3, 2022 ยท 1 min