So I am making a web app using Flask. And I want the app.py file to get the id of an html div from the index.html file
<td><a href="/edit" id="{{ i 1 }}">Edit</a>    <a href="/delete">✖</a></td>
the {{ i 1 }} is in jiinja format. I want that to be sent to app.py when Edit is clicked
CodePudding user response:
maybe
href="/edit?{{i 1}}"- Ouroborus
Good ideea.
<td>
<a href="/edit/?id={{i 1}}">Edit</a>
    
<a href="/delete">✖</a>
</td>
and the backend:
@app.route('/edit/')
def edit():
Id = request.args.get("id")
# ...
