- Flask Framework Cookbook(Second Edition)
- Shalabh Aggarwal
- 146字
- 2021-06-24 13:58:01
Getting ready
In this recipe, we will try to create a small application where we will have a home page and a product page (such as the ones we see on e-commerce stores). We will use the Bootstrap framework to give a minimalistic design to our template. Bootstrap can be downloaded from http://getbootstrap.com/.
The version of Bootstrap used in this book is version 3. Different versions of bootstrap might cause the UI of an application to behave in different ways, but the core essence of Bootstrap remains the same.
In this section, we have a hardcoded data store for a few products found in the models.py file. These are read in views.py and are sent over to the template as template context variables via the render_template() method. The rest of the parsing and display is handled by the templating language, which in our case is Jinja2.