2017-11-11 111 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一些錯誤,以及把你的錯誤信息