Create your own template tag and display this variable as a template. For example, see how the "ssi" tag is written.
On the other hand, can you display this line in your view? In any case, this is an unverified version of this tag:
@register.tag def render_string(parser, token): bits = token.contents.split() if len(bits) != 2: raise TemplateSyntaxError("...") return RenderStringNode(bits[1]) class RenderStringNode(Node): def __init__(self, varname): self.varname = varname def render(self, context): var = context.get(self.varname, "") return Template(var).render(context)
source share