return 'index'

@app.errorhandler(500)
def internal_error(error):
    return '500 error'

@app.errorhandler(404)
def not_found(error):
    return '404 error', 404
if __name__ == '__main__':
    app.run(debug=True)
Catching a 500 server error in Flask