Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bottle
- from bottle import jinja2_template as template
- from jinja2 import Environment
- def cut(value):
- return value[:7]
- env = Environment()
- env.filters['ss'] = cut
- @bottle.route('/')
- def test():
- foo = "klsjadlkjdalkdjdaskldjad007"
- return template('''
- foo value: {{ ss(foo) }}
- and {{ foo|ss }}
- ''', foo=foo)
- bottle.run(host='localhost', port=9090, debug=True, reloader=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement