I'm trying to write a simple dropdown menu from a list in flask. For some reason, the dropdown list is empty... I'd appreciate all hints :-)
app.py (fragment)
@app.route("/getLigand", methods=["GET","POST"])
def dropdown():
colours = ["Red", "Blue", "Black", "Orange"]
return render_template("run_ligand.html", colours=colours)
run_ligand.html (fragment)
<form name="Item_1" action="/getLigand" method="POST">
<label for="exampleFormControlFile2">Choose colour</label>
<select name=colours>
{% for colour in colours %}
<option value="{{colour}}" SELECTED>{{colour}}</option>
{% endfor %}
</select>
</form>