Created
November 21, 2017 22:38
-
-
Save mlivingston40/956804e85d3ffd55087db090546f94e5 to your computer and use it in GitHub Desktop.
Error routing for 'page note found' and 'internal server error' in flask
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
# “404 Page Not Found” | |
@application.errorhandler(404) | |
def page_not_found(e): | |
return render_template('404.html'), 404 | |
# “500 Internal Server Error” | |
@application.errorhandler(500) | |
def page_not_found(e): | |
return render_template('500.html'), 500 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment