feature: 错误页面返回
This commit is contained in:
+13
-1
@@ -1,4 +1,4 @@
|
||||
from flask import Flask
|
||||
from flask import Flask, render_template
|
||||
|
||||
from configs import config
|
||||
from pear_admin.apis import register_apis
|
||||
@@ -17,4 +17,16 @@ def create_app(config_name="dev"):
|
||||
|
||||
register_views(app)
|
||||
|
||||
@app.errorhandler(403)
|
||||
def handle_404(e):
|
||||
return render_template("error/403.html")
|
||||
|
||||
@app.errorhandler(404)
|
||||
def handle_403(e):
|
||||
return render_template("error/404.html")
|
||||
|
||||
@app.errorhandler(500)
|
||||
def handle_500(e):
|
||||
return render_template("error/500.html")
|
||||
|
||||
return app
|
||||
|
||||
Reference in New Issue
Block a user