The Django web framework contains its own template engine for generating HTML, XML and other output formats.
A project template contains the files and code to start a new web application.
For example, when you run django-admin.py startproject abc
, the Django
admin script creates a new abc
directory along with several Python
configuration so the web app can be run by a WSGI server.
Django templates are different from a project template because they live within a project and are written by the developer to generate output, most commonly HTML.
Make ALL Your Django Forms Better presents some tricks for customizing Django templates to handle the widgets on your site.
Python Templating Performance Showdown: Django vs Jinja provides some benchmarks for how Django templates compare with Jinja templates. Note that as with any benchmarks these only provide a few data points that can be useful rather than a definitive statement that one tool is always faster than the other.
Reconciling Backend Templates with Frontend Components explains how to use React components with the traditional server-side Django templates despite some mismatch in how each tool approaches the end goal of rendering a webpage.
When and how to use Django TemplateView
is not specifically about using the Django template engine, but instead
how to use the TemplateView
in your views which lead directly into
rendering a template.