@auth.errorhandler(429)
def login_rate_limit_error(error):
 return render_template('errors/too_many_logins.html', timeout=error.description)

@ auth . errorhandler ( 429 ) def login_rate_limit_error ( error ) : return render_template ( 'errors/too_many_logins.html' , timeout = error . description )
register a custom error handler for a too many requests error .