I'm developing a tourism website using flask. I have a destinations folder with names of cities. When the dropdown navigation item is clicked, these cities appear and upon click on a city, the page should be redirected to the relevant city. The navigation code is as follows;
<li><a href="#">Destinations</a>
<ul class="nav-dropdown">
<li><a href="destinations/london">London</a></li>
<li><a href="destinations/paris">Paris</a></li>
<li><a href="destinations/newyork">New York</a></li>
<li><a href="destinations/moscow">Moscow</a></li>
<li><a href="destinations/vegas">Las Vegas</a></li>
<li><a href="destinations/pataya">Pataya</a></li>
</ul>
</li>
The demo.py code is as follows;
from flask import Flask, render_template
@app.route('/destinations/{id}', methods = ['GET'])
def destinations(id):
page = 'destinations/'+id+'.html'
return render_template(page)
How to route this pages properly?