Django: cannot pass variable to included template?
- by duy
Hi,
I got a problem where I want to use template including in Django.
Here is the real example:
I got 3 file: home.html (will get the context variable passed from Views), base.html (the skeleton template file) and the header.html (included by base.html).
If if put the code below directly in base.html without including the header.html, the {{title}} variable passing from home is correctly called. But if I include the header.html in base.html, the {{title}} variable's value cannot be called.
<title>{% block title %}{% endblock %} | {{ SITE_INFO_TITLE }}</title>
Is there any solution to this problem? Thanks.