8.5 Creating Templates for StartupForm, NewsLinkForm, and PostForm

The process for building our templates is very straightforward. We begin by inheriting our app base template, and then override the title and content blocks. In our content block, we must:

1. create an HTML form tag

2. invoke the creation of the CSRF tag via {% csrf_token %}

3. display the form variable passed to the template RequestContext

4. display a submit button.

If we follow the steps above, our template for StartupForm, coded in /organizer/templates/organizer/startup_form.html, will look like the code in Example 8.32.

Example 8.32: Project Code

organizer/templates/organizer/startup_form.html in 42175702d5

 1   {% extends parent_template

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.