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.

Asked By: Fabian Joseph

||

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)
Answered By: Fabian Joseph
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.