mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Fixed #17356 -- Allowed {% include %} to render compiled templates
Reviewed by Loic Bistuer and Tim Graham.
This commit is contained in:
parent
169637649b
commit
5cdacbda03
4 changed files with 27 additions and 2 deletions
|
@ -691,6 +691,12 @@ the variable ``template_name``::
|
|||
|
||||
{% include template_name %}
|
||||
|
||||
.. versionchanged:: 1.7
|
||||
|
||||
The variable may also be any object with a ``render()`` method that
|
||||
accepts a context. This allows you to reference a compiled ``Template`` in
|
||||
your context.
|
||||
|
||||
An included template is rendered with the context of the template that's
|
||||
including it. This example produces the output ``"Hello, John"``:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue