Issue
I am a newbie in the flask development this is my first program in the flask but it shows me this error:
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
& this is my code
from flask import Flask
app = Flask(__name__)
@app.route('/index')
def index():
return 'Hello World'
if __name__ == '__main__':
app.run(debug=True)
Solution
I think you should just go to http://localhost:5000/index or http://127.0.0.1:5000/index but if you want to make that page your code should be like that
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello World'
if __name__ == '__main__':
app.run(debug=True)
change @app.route('/index')
to @app.route('/')
also you should check this http://flask.pocoo.org/docs/0.12/quickstart/#routing
Answered By - Fatih Kılıç
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.