Creating a base template with Bootstrap
We currently have two templates (index.html
and about.html
) that duplicate the structure of the site and some HTML tags. Currently, it doesn’t seem like a serious issue. However, once the application starts growing, we will have a lot of duplicated HTML code spread over dozens of template files. To avoid this issue, we will create a base template that contains the main structure of the site over a single file, and the other templates will extend this base template.
Introducing Bootstrap
Bootstrap is the most popular CSS framework for developing responsive and mobile-first websites (see Figure 3.1). Bootstrap provides a set of HTML, CSS, and JavaScript components and utilities that developers can use to build modern user interfaces quickly. For Django projects, a developer can design the user interface from scratch if they want to. However, as this book is not about user interfaces, we will take advantage of CSS frameworks (such as...