If you want your application on same port i.e port=5000 then just in your terminal run this command:
fuser -k 5000/tcp
and then run:
python app.py
If you want to run on a specified port, e.g. if you want to run on port=80, in your main file just mention this:
if __name__ == '__main__':
app.run(host='0.0.0.0', port=80)