1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #17356 -- Allowed {% include %} to render compiled templates

Reviewed by Loic Bistuer and Tim Graham.
This commit is contained in:
Curtis Maloney
2013-08-28 22:17:20 +10:00
committed by Anssi Kääriäinen
parent 169637649b
commit 5cdacbda03
4 changed files with 27 additions and 2 deletions

View File

@@ -159,8 +159,11 @@ class IncludeNode(BaseIncludeNode):
def render(self, context):
try:
template_name = self.template_name.resolve(context)
template = get_template(template_name)
template = self.template_name.resolve(context)
# Does this quack like a Template?
if not callable(getattr(template, 'render', None)):
# If not, we'll try get_template
template = get_template(template)
return self.render_template(template, context)
except:
if settings.TEMPLATE_DEBUG: