Skip to content

Instantly share code, notes, and snippets.

@rizkyabdilah
Created June 9, 2012 06:23
Show Gist options
  • Save rizkyabdilah/2899800 to your computer and use it in GitHub Desktop.
Save rizkyabdilah/2899800 to your computer and use it in GitHub Desktop.
set jinja2 global environment on bottlepy
#!/opt/python/bin/python
from bottle import BaseTemplate
class ExampleGlobal(object):
name = "Hello World"
gob = ExampleGlobal()
BaseTemplate.global_config('jinja2_global_env', {'gob': gob})
## do with your creativity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment