Skip to content

Instantly share code, notes, and snippets.

@ten0s
Created September 11, 2015 15:21
Show Gist options
  • Save ten0s/40ecec1aace02cbc4051 to your computer and use it in GitHub Desktop.
Save ten0s/40ecec1aace02cbc4051 to your computer and use it in GitHub Desktop.
How to debug jinja2 templates
In [1]: from jinja2 import Template
In [2]: Template("{{s.split('-')}}").render(s='a-bad-string')
Out[2]: u"['a', 'bad', 'string']"
@ten0s
Copy link
Author

ten0s commented Jul 28, 2016

Template("releases/{{ver.split('-')[0]}}/sys.config").render(ver='v2.1-28-g6379b92')
u'releases/v2.1/sys.config'

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