Flask Framework Cookbook(Second Edition)
上QQ阅读APP看书,第一时间看更新

How it works...

In the preceding template structure, there is an inheritance pattern being followed. The base.html file acts as the base template for all other templates. The home.html file inherits from base.html, and product.html inherits from home.html. In product.html, the container block is overwritten, which was first populated in home.html. When this app is run, we should see output similar to that shown in the following screenshot:

The preceding screenshot shows how the home page will look. Note the URL in the browser. The product page should appear as follows: