Jinja2

From Federal Burro of Information
Revision as of 15:47, 29 July 2014 by David (talk | contribs) (Created page with " <pre> [user@server common]$ python py_check some randome string The test worked [user@server common]$ cat py_check from jinja2 import Environment, FileSystemLoader env = Envi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
[user@server common]$ python py_check
some randome string
The test worked
[user@server common]$ cat py_check
from jinja2 import Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader('/home/user/project/files/common'))
tmpl = env.get_template('test.j2')
something = 'some randome string'
print tmpl.render(something=something)

[user@server common]$ cat test.j2
{{ something }}
The test worked
[user@server common]$