Why do I get a "404 Not Found" error even though the link is on the server? Why do I get a "404 Not Found" error even though the link is on the server? flask flask

Why do I get a "404 Not Found" error even though the link is on the server?


You need to create another route for your signup URL, so your main webapp code needs to add a route for '/signup.html', i.e.

from flask import Flaskfrom flask import render_templateapp = Flask(__name__)@app.route('/')def runit():    return render_template('index.html')@app.route('/signup.html')def signup():    return render_template('signup.html')if __name__ == '__main__':    app.run()

If you want your URLs to be a little cleaner, you can do something like this in your Python:

@app.route('/signup')def signup():    return render_template('signup.html')

And change your link code to match.

<a class="btn btn-lg btn-success" href="signup">Sign up</a>

The main Flask documentation has a good overview of routes in their Quickstart guide: http://flask.pocoo.org/docs/quickstart/