An internal server error is an HTTP 500 error, not a 404 error, and you have not added an error handler to it. This occurs when the server cannot complete the client request properly. To add a gracious message when such an error occurs, you can add an error handler, for example, 404.
@app.errorhandler(500) def exception_handler(e): return render_template('500.html'), 500
source share