2017-11-11 112 views

回答

1

写custome错误页面,在烧瓶神社模板,显示要闪烁屏幕上的方式

from flask import render_template 

@app.errorhandler(500) 
def page_not_found(e): 
    return render_template('500.html'), 404 

#An example template might be this for your 5000.html, you can write 
#your own through this code: 

{% extends "layout.html" %} 
{% block title %}Page Not Found{% endblock %} 
{% block body %} 
    <h1>Page Not Found</h1> 
    <p>What you were looking for is just not there. 
    <p><a href="{{ url_for('index') }}">go somewhere nice</a> 
{% endblock %} 
+0

真棒!不知道最简单的方法是什么,但这可能会奏效,谢谢! – douglasrcjames

-1

500,这意味着有你demo.may一些错误,以及把你的错误信息