best_tags.render_template

best_tags.render_template(value)

Render a string as it was a Django template

It will use the same context as the outer template.

Example

>>> c = {'mytemplate':'my value = {{myvar}}',
...      'myvar':'myvalue'}
>>> t = '''{% load best_tags %}My template : {{ mytemplate }}
... with myvar = {{myvar}}
... My template rendered : {% render_template mytemplate %}'''
>>> print(Template(t).render(Context(c)))
My template : my value = {{myvar}}
with myvar = myvalue
My template rendered : my value = myvalue