Chapter 7. Implementing Django Templates to Create Custom Views

What You’ll Learn in This Hour

  • How to configure the template directory for a project
  • How to create templates in the Django shell
  • How to render views using templates
  • How to extend templates
  • How to embed templates in other templates

So far, all the examples of web pages that you have created in your views have been hard-coded by Python code that generates an HTML web page. This has worked well because the web pages that you have created have been basic.

As you create more advanced web pages, you will want to begin using the Django template system. The Django template system allows you to write template files that define the presentation of the web page independent of the data. This means ...

Get Sams Teach Yourself Django in 24 Hours 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.