How to add separate templates for separate pages in flask

A little bit about templates in flask.

My flask file structure.Simply store all your main code, back end code in app.py. Then all the layout arrangement, template code is in templates.

Image by Author

Then inside the templates folder store the html files. The index.html bears layout for the main page, that is home page of app.py. In the code the one that routes to home, or index. The v_timestamp.html bears code for the v_timestamp page.

Image by Author

Keep in mind in the app.py to write this piece of code. Here simply instructed upon routing to the home page or index page render the index.html template and upon routing to the v_timestamp page render the _timestamp.html template.

Thanks for reading. Have fun coding !!!!!

Student at University of Moratuwa