finish custom errors page
This commit is contained in:
@@ -2,4 +2,4 @@ from flask import Blueprint
|
||||
|
||||
main = Blueprint('main', __name__)
|
||||
|
||||
from . import views
|
||||
from . import views, errors
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
from flask import render_template, request, jsonify
|
||||
from . import main
|
||||
|
||||
|
||||
@main.app_errorhandler(403)
|
||||
def forbidden(e):
|
||||
|
||||
return render_template('403.html'), 403
|
||||
|
||||
|
||||
@main.app_errorhandler(404)
|
||||
def page_not_found(e):
|
||||
|
||||
return render_template('404.html'), 404
|
||||
|
||||
|
||||
@main.app_errorhandler(500)
|
||||
def internal_server_error(e):
|
||||
|
||||
return render_template('500.html'), 500
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Blog_mini -禁止访问{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<h1>亲,您没有访问的权限哦!</h1>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Blog_mini -无法找到该页面{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<h1>嘿嘿,您要找的页面不存在哦!</h1>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Blog_mini -服务器内部问题{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<h1>不好意思哦,我出现了点小问题哦!</h1>
|
||||
</div>
|
||||
{% endblock %}
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user