bittersweet.templatetags.bittersweet_render_inline module¶
Render a template variable as Django template source in the current context
Bases:
django.template.base.Node
A template tag which renders its contents as a template using the current context, allowing you to process template code stored in something like gettext blocks, model content,
django-flatblocks
, etc. as if it was actually in the current template.Usage:
my_template.html:
{% render_inline %} <b>{{ VARIABLE_WHICH_CONTAINS_TEMPLATE_MARKUP }}</b> {% end_render_inline %}
Context:
{'VARIABLE_WHICH_CONTAINS_TEMPLATE_MARKUP': 'Hello {{ CURRENT_USER.name }}'}
Output:
'<b>Hello J. Random User</b>'