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