Skip to content

Instantly share code, notes, and snippets.

@mlivingston40
Created November 21, 2017 22:38
Show Gist options
  • Save mlivingston40/956804e85d3ffd55087db090546f94e5 to your computer and use it in GitHub Desktop.
Save mlivingston40/956804e85d3ffd55087db090546f94e5 to your computer and use it in GitHub Desktop.
Error routing for 'page note found' and 'internal server error' in flask
# “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