4.3 Understanding Django Templates and Their Goals

In the real world, such as in metalworking, a template is a mold used to shape or pattern a material. In computing, typically in the context of a word processor, a template is a file that comes with a preset format and preset content, which the user then fills in with more content.

Django templates take elements from both real-world templates and word-processing templates. A Django template is an external file or document that acts as a guide or blueprint for data, while also providing preset content. These blueprints, written by the developer, allow Django to quickly generate markup content to be returned to the user.

An easy way to think about templates is to liken them to fill-in-the-blank ...

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.