11.3.3 Contact Templates

We have two tasks: we need a template to display the contact form, and we need to modify our templates to display messages from the messages framework.

Let’s start with the contact template. As with our other apps, it’s first in our interest to have a template that inherits from the site’s base template and from which all our other app templates inherit. We create two directories, /contact/templates/ and /contact/templates/contact/ (for namespacing purposes), and then create base_contact.html, as shown in Example 11.13.

Example 11.13: Project Code

contact/templates/contact/base_contact.html in 3969d84738

1 {% extends parent_template|default:"base.html" %}

Recall from Section 11.3 the fourth ...

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.