Skip to content

Instantly share code, notes, and snippets.

@kurozumi

kurozumi/app.py

Created Jul 9, 2016
Embed
What would you like to do?
【Python】Bottleで404 Not Foundページをカスタマイズする
from bottle import route, run, template, error
import os
@error(404)
def error404(error):
return template("<h1>{{error_message}}</h1>", error_message="404 Not Found.")
run(host="0.0.0.0", port=int(os.environ.get("PORT", 5000)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment