@app.errorhandler('''error number''') def resource_not_found(e): return render_template('''page to render'''), '''error number'''