Created
September 7, 2016 14:08
-
-
Save irlevesque/30cf8b29345353024ebf0489fd4ca30b to your computer and use it in GitHub Desktop.
Testing jinja templating in python REPL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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 | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment