Can't route to "/login" with flask?

flask, python, url

Solution

Please read the flask quickstart Unique URLs / Redirection Behavior, URL canonicalization and Trailing slash in URLs - which style is preferred?

Problem

When I type `/login` as url,it will go wrong For example: ``` from flask import Flask ,url_for,render_template,request app = Flask(__name__) @app.route('/login') def index(): return "index" if __name__== "__main__": app.run() ``` The error turn out to be like this: ``` Not Found. The requested URL was not found on the server. ``` When I replace `/login` with `/login/` or any other words like `/log` , it will be all right. How does that happen?

Original source

Related problems