【Python】【Bottle】 HTTP Errors and Redirects

■HTTP Errors and Redirects
ということで、特定のURLに飛んだときに
エラーページを表示させるためには
abort(コード, 文字列)を使用する。
from bottle import route, abort
@route('/httpstat')
def restricted():
abort(404, "これはテスト")
404だけでなく、当然他のコードも使用できる。

リダイレクトはredirectを使用する。
from bottle import redirect
@route('/world')
def wrong():
redirect("/hello")

@route('/hello')
def hello():
return "Hello!"