With Python Bottle microframework, I'm using:
@route('/')
@view('index.tpl')
def index():
context = {'request': request, 'custom': ''}
return (context)
@route('/test')
@view('test.tpl')
def test():
context = {'request': request, 'custom': ''}
return (context)
@route('/test2')
@view('test2.tpl')
def test2():
context = {'request': request, 'custom': ''}
return (context)
but there is some redundancy in the code. Is there a way to have a simpler routing in this case?
Note: I'm thinking about moving to Flask soon, so I would be interested for a solution working for both.