O'Reilly logo

Python Requests Essentials by Bala Subrahmanyam Varanasi, Rakesh Vidya Chandra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Templates

A template is a simple text document which contains block tags or variables. Flask micro-framework makes use of the Jinja2 template engine for rendering the HTML pages.

In our application, we use five different templates which includes a base template—base.html. This base template is a layout consisting of the common elements of all the templates. The four other templates (index.html, show.html, vote.html and new.html) make use of a concept called template inheritance provided by the Jinja2 template engine. It is used to enable those common features to get showed up without a redundant code in every template.

The base template

This template is a skeleton for all the other templates. It contains a common navigation menu section and a placeholder ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required