Chapter 3. Creating Views with Templates

Now that we have our data in an easily accessible format, displaying the information in a web page becomes much easier. In this chapter, we will use the included templating language for Flask Jinja, to dynamically create HTML from our SQLAlchemy models. We will also examine Jinja's methods to automate the creation of HTML and modify data for presentation inside a template. Then, the chapter will end with automatically creating and validating HTML forms with Jinja.

Jinja's syntax

Jinja is a templating language written in Python. A templating language is a simple format that is designed to help automate the creation of documents. In any templating language, variables passed to the template replace predefined ...

Get Mastering Flask now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.