November 2015
Beginner to intermediate
840 pages
26h 30m
English
Before we get started, a quick look at the documentation will tell us that the flatpage app expects a template to display the FlatPage instances with a title field and a content field. We first create the template namespace necessary for the flatpage templates, as shown in Example 15.5.
Example 15.5: Shell Code
mkdir -p templates/flatpages
We can then create the templates/flatpages/default.html using the code shown in Example 15.6.
Example 15.6: Project Code
templates/flatpages/default.html in 75c781118d
1 {% extends parent_template|default:"base.html" %} 2 3 {% block title %} 4 {{ block.super }} - {{ flatpage.title }} 5 {% endblock %} 6 7 {% block content %} 8 <div> ...
Read now
Unlock full access