Designing a Base Template
Django projects can consist of dozens or hundreds of template files. Sometimes, these files can contain duplicated HTML and CSS code, which affects the project’s maintainability. In this chapter, we introduce the concept of base templates and how they can be used to reduce duplicated template code. We will also improve the look and feel of our application by designing a base template that includes a header and a footer, as well as links to different pages.
In this chapter, we will be covering the following topics:
- Creating a base template with Bootstrap
- Updating the Home page to use the base template
- Updating the About page to use the base template
- Adding a header section
- Adding a footer section
In the end, you will learn the importance of base templates and how they can be used to reduce duplicated code and improve the look and feel of your web applications.