Redirecting to another page with button click in Python-flask
buttons, and redirects with flask

Hi, so first refer my tutorial “How to add separate templates for separate pages in flask”. Inside the templates folder there is an index.html which contains the instructions for the arrangement of layouts in the homepage or index page. code of index.html.
<!DOCTYPE html>
<html>
<head>
<title></title> <link rel="stylesheet" href="{{ url_for('static', filename='home.css') }}">
</head>
<body><h2>Vehicle info Dashboard</h2><p align="center"><a href=vmd_timestamp ><button class=grey style="height:75px;width:150px">vmd timestamp</button></a></p></body>
</html>
This is how the homepage looks like.

Here I have added the button inside a paragraph element, and inside this same paragraph element which contains the button, there is an a href, anchoring element, which leads to the vmd_timestamp, you can add the name of the route page which you wish to lead.
app.py code, in my case I am directing index or home page to vmd_timstamp via a button click event as described above.
from flask import Flask, request,render_template
app = Flask(__name__)@app.route('/')
def index(): return render_template('index.html')@app.route('/vmd_timestamp')
def vmd_timestamp():return render_template('vmd_timestamp.html')
Thanks for reading. Have fun coding !!!!