@app.route("/search") def search(): return render_template("/search.html") ][1]
This the code used in my app.py. I have tried
{href=”./search.html”}
but there is no difference.
Edit How my project folder looks like Edit 2: My mistake in the routing
Advertisement
Answer
EDIT
to link your routes from within your HTML pages, you can use the url_for
function inside double curly brackets. so in your case it would be something like this:
<a href="{{url_for('search')}}">Search Page</a>
note that the value you pass into url_for
is the name of the function for your route, not the route itself.
see this answer for more info.