Created
July 9, 2016 03:25
-
-
Save kurozumi/de0788fc359ac7c78255e000c498b94e to your computer and use it in GitHub Desktop.
【Python】Bottleで404 Not Foundページをカスタマイズする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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