0

Whenever I am trying to visit 'http://127.0.0.1:5000/welcome' I am supposed to get 'Welcome to flask tuitorial' but I am getting 'The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.' if trying visit 'http://127.0.0.1:5000/', I am getting 'Hello World'. I didnt write any route method for that. That hello_world program I had done long back ago. Still why its coming I don't know. Today my project is different and my program as well different but still I am getting same o/p.

from flask import Flask
  app = Flask(__name__)

@app.route('/welcome')
def hello_world():
  return 'Welcome to flask tuitorial'

if __name__ == '__main__':
  app.run(debug = True)
Meister96Fels
  • 508
  • 1
  • 8
  • 26
VVK kumar
  • 267
  • 3
  • 5
  • 15
  • try `app.run(host='0.0.0.0', port=5000, debug=True)` You can replace 0.0.0.0 with 127.0.0.1 too. – BarathVutukuri Jan 22 '19 at 06:49
  • how are you "running" the code? you might be running that same old server unknowingly. also, clear cache. – Paritosh Singh Jan 22 '19 at 06:51
  • if i will visit through any browser to this link 'http://127.0.0.1:5000/' getting the same Hello World as o/p. i didnt even run any python app.py but still getting. – VVK kumar Jan 22 '19 at 06:56
  • Guys i have tried to change hostname only it works . like app.run(host='127.0.0.5', port=5000, debug=True) .But i just wondering how to solve this with this hostname ''127.0.0.1:5000' – VVK kumar Jan 22 '19 at 07:02
  • 1
    finally i got the way to solve this problem. [How to stop a running port in windows 10](https://stackoverflow.com/questions/39632667/how-to-kill-the-process-currently-using-a-port-on-localhost-in-windows) – VVK kumar Jan 22 '19 at 07:12

0 Answers0