Django include Tag

Django include Tag

Include

The include tag allows you include a template inside the current template.

This is useful when you have a block of content that are the same for many pages.

Example

footer.html:

template.html:

Run Example »


Variables in Include

You can send variables into the template by using the with keyword.

In the include file, you refer to the variables by using the {{ variablename }} syntax:

Example

mymenu.html:

template.html:

Run Example »

ArmenianEnglish