4.7.5 Using the Generic Templates in the Rest of the App Templates

For the sake of brevity, we look at only one more example of how to integrate the generic template with our app template, in this case the list of Startup objects.

There are three steps to properly configuring each app template:

1. Surround the content in the file with {% block content %} and {% endblock %}.

2. Extend the app base template.

3. Override the title by using the block template tag.

The truth is that doing so for each and every app template is tedious and straightforward. In a normal project, we would typically start with the site-wide generic template before programming the app templates (where, in turn, we’d start with the app base templates). We did so in reverse ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.