The links using url_for in the template all point to the 404 page, such as:
<li><a href="{{ url_for('auth.logout') }}">登出</a></li>
Click the logout button to go to the 404 page
But if I use 127.0.0.1:5000/logout, I can log out
The results of url_for in the template file are None, so when clicking any link the URL becomes 127.0.0.1:5000/None. If such a route is added:
@main.route("/None")
def test():
return "None"
Click on any link to jump to test
Since you set all routes to
/None
, naturally only the view function corresponding to this route will be skipped, which is the test.