4.7.4 Building the App-Generic Templates

Typically, developers do not inherit app templates directly from the base template. Instead, each app defines an intermediary template, which inherits from the base. This allows apps to define their own behavior. A template thus first inherits from the app base template, which in turn inherits from the project base template.

At the moment, we don’t actually have anything to place in the app base template, so this may seem silly. However, following this convention can save you time in the long run, as we shall see in Chapter 16: Serving Static Content with Django.

To start, we can create a base template for our organizer app: organizer/templates/organizer/base_organizer.html. The contents at this point ...

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.