Django Tutorial · Django Syntax

Django Include

Learn all about Django Include in this comprehensive tutorial.

5 min read intermediate
  • The include tag allows you to include a template inside the current template.
  • You can send variables into the template by using the with keyword.

Include

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

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

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:

Module quiz

2 questions
1

Which of the following is true about Django Include?

2

What is the most common pitfall when working with Django Include?

Answer all questions to submit.