8.1 Introduction

In this chapter, we build templates to display the Django forms we built in Chapter 7: Allowing User Input with Forms. We start by programming our TagForm template manually in HTML, without any use of the context variables passed to the template. We introduce RequestContext variables and slowly replace pieces of our HTML with these variables (the variables will output exactly what we coded). The first solution we examine requires the most work but affords us the most control. Our final solution requires the least amount of work, but also affords us less control. In between the first and final solutions, we will iterate through a number of options, gradually relinquishing control in favor of less code.

The templates we build ...

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.