【Python】【Bottle】 Query Variables

■Query Variables
クエリパラメータの指定は
request.query.文字列
で指定可能。

# coding:utf-8
from bottle import route, request, response, template
@route('/test')
def test():
no = request.query.luckyno or 0
return template('Lucky No.{{no}}', no=no)

if __name__ == '__main__':
run(host='127.0.0.1', port=8080, debug=True, reloader=True)

http://localhost:8080/test?luckyno=9」にアクセスすると
「Lucky No.9」と表示される。