...

/

How Do We Use HTML Templates?

How Do We Use HTML Templates?

In this lesson, we will learn how to serve HTML templates in our Flask application.

Introduction

In this lesson, we will learn how to render static templates, instead of plain text, on the front-end using the Flask framework.

Static templates

Static templates are the HTML files which remain constant. In fact, the standard HTML files are static in nature. Whenever the same file is rendered, it shows the same output unless the file is updated.

In a real-world web application, we expect an HTML file to be returned and rendered on the browser screen from the view function instead of a String.

Note: We assume that you are already familiar with the basics of HTML and CSS in the context of all lessons of Flask you will be studying.

Rendering HTML templates

HTML can be ...