Jinja leave template tags after render
jinja2, python
Solution
`jinja2.Environment` constructor accepts `undefined` parameter, to control the behaviour in this case. By default it is `jinja2.Undefined` which outputs nothing, but you could also use `jinja2.DebugUndefined` or write your own implementation.
For example:
env = jinja2.Environment(undefined=jinja2.DebugUndefined)
t = env.from_string("{{foo}}{{bar}}")
t.render(foo=123) # will print u'123{{ bar }}'
Problem
The basic question of this topic is how to leave template tag if it is not define at context. For example: ``` from jinja2 import Template template = Template('User {{Name}} have received {{count}} mails') result = template.render({'count': 30}) ``` In this case jinja will replace {{Name}} with '', how make jinja leave {{Name}} in template instead of ''. Thanks a lot.