my Flask python server still running after shutdown
Question:
I Tried running a new http://127.0.0.1:5000/ local server and the old one was still showing after I stopped it and hard reload.
my Chorme still show pervious server results after I’ve ended the program and when I ran another program it shows same result as old one.
Answers:
Just change sever port from 5000 to 8000 for new program
#Add host="localhost", port=8000
if __name__ == '__main__':
app.run(debug=True)
This way:
@app.route("/")
def hello():
return "Hello World!"
if __name__ == '__main__':
app.run(host="localhost", port=8000, debug=True)
I Tried running a new http://127.0.0.1:5000/ local server and the old one was still showing after I stopped it and hard reload.
my Chorme still show pervious server results after I’ve ended the program and when I ran another program it shows same result as old one.
Just change sever port from 5000 to 8000 for new program
#Add host="localhost", port=8000
if __name__ == '__main__':
app.run(debug=True)
This way:
@app.route("/")
def hello():
return "Hello World!"
if __name__ == '__main__':
app.run(host="localhost", port=8000, debug=True)