Skip to content

Instantly share code, notes, and snippets.

@SEJeff
Created December 4, 2012 19:19
Show Gist options
  • Save SEJeff/4207694 to your computer and use it in GitHub Desktop.
Save SEJeff/4207694 to your computer and use it in GitHub Desktop.
Testing jinja from the python interactive shell
>>> from jinja2 import Template
>>> tmpl = """{% if name != "Jeff" %}Nothing to see here move along{% else %}
... hello {{name}}, how are you?{% endif %}"""
>>> template = Template(tmpl)
>>> print template.render({"name": "Jeff"})
hello Jeff, how are you?
>>> print template.render({"name": "John"})
Nothing to see here move along
>>>
@shiplu
Copy link

shiplu commented Jul 21, 2016

Thanks! a lot!

@slallum
Copy link

slallum commented Feb 1, 2017

👍

@dwgillies
Copy link

:+100:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment