6. Templates and Form Processing

Now that you’ve learned about Django’s data models and logic processing, it’s time for the final piece of the puzzle: how to display information and manage user input. We start with an overview of Django’s template language and rendering system with the second half of the chapter covering forms and form processing.

Templates

As touched on in previous chapters, templates are stand-alone text files containing both static content (such as HTML) and dynamic markup specifying logic, looping, and the display of data. The decision of which template to use and what set of data to render it with is made either in the view function itself (via explicit rendering or the use of render_to_response) or in the view’s arguments ...

Get Python Web Development with Django® 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.