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:
committed by
Anssi Kääriäinen
parent
169637649b
commit
5cdacbda03
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user