November 2015
Beginner to intermediate
840 pages
26h 30m
English
FlatPagesBefore we go, reexamine our flatpages template in templates/flatpages/default.html, shown in Example 15.25
Example 15.25: Project Code
templates/flatpages/default.html in 4b8bef1bdb
9 <div> 10 <h1> {{ flatpage.title }}</h1> 11 {{ flatpage.content }} 12 </div>
In most cases, we’re going to want to store HTML in the content field of FlatPage objects. As mentioned in Chapter 4: Rapidly Producing Flexible HTML with Django Templates, all of the string variables output in Django templates are escaped. Anything that is a special character in HTML (such as <) will become an HTML entity, as shown in Example 15.26.
Example 15.26: Python Interpreter ...
Read now
Unlock full access