Learn Before
Code

DTL Template Inheritance Syntax

In a parent template called 'parent.html', blocks are included like so:

{% block block_name %} BASIC CONTENT GOES HERE {% endblock %}

To utilize the parent template in another template, use the following syntax:

{% extends parent.html %} {% block block_name %} NEW, CHANGED CONTENT GOES HERE {% endblock %}

Note that the 'extends' block must be the first thing in the child template.

0

2

Updated 2021-03-12

Tags

Python Programming Language

Data Science