In this Flask video lesson we want to learn How to Use Templates in Flask, so first of all let’s talk about Flask Templates.
What is Flask Templates ?
Flask Templates are HTML files that contain placeholders for dynamic data that will be rendered by Flask when a web page is requested. Flask uses templating engine called Jinja2 to render templates and generate dynamic HTML pages. in Flask, templates are stored in the application templates directory, which is typically located in the same directory as the application code. Flask supports different template formats, including HTML, XML and plain text. for using a template in Flask, we can create new HTML file in the templates directory and define variables that will be populated with dynamic data at runtime. Flask uses Jinja2 syntax to define variables, control structures and macros within templates, so now let’s learn this in our video lesson practically.