Error 404 on second route using Flask

Asked

Viewed 78 times

0

Good morning.

I configured my app in Cpanel that uses passenger_wsgi.py (I don’t know if this information is relevant)

Python Version 3.7.3 and Flask Version==1.1.1

The main route works well, but the second when I try to access gives error 404.

Someone’s been through this trouble before?

Follow the code: (url: http://funtraveldetective.com/ftd)

from flask import Flask
app = Flask(__name__)
application = app # our hosting requires application in passenger_wsgi

@app.route('/')
def index():
    return 'Index Page'

@app.route('/teacher/')
def hello_teacher():
    return 'Hey Teacher'

if __name__ == "__main__":
    app.run(debug=True) 

1 answer

0

Try to remove the end bar and leave only '/Teacher'

thus:

@app.route('/teacher')
def hello_teacher():
    return 'Hey Teacher'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.