diff --git a/app/errors/handlers.py b/app/errors/handlers.py index 4a40ad9e..eaa52bc1 100644 --- a/app/errors/handlers.py +++ b/app/errors/handlers.py @@ -3,9 +3,11 @@ from app import db from app.errors import bp -@bp.app_errorhandler(404) -def not_found_error(error): - return render_template('errors/404.html'), 404 +# 404 error handler removed because a lot of 404s are just images in /static/* and it doesn't make sense to waste cpu cycles presenting a nice page. +# Also rendering a page requires populating g.site which means hitting the DB. +# @bp.app_errorhandler(404) +# def not_found_error(error): +# return render_template('errors/404.html'), 404 @bp.app_errorhandler(500)