コード例 #1
0
ファイル: __init__.py プロジェクト: zhangst23/tutorial
 def page_not_found(error):
     if request.is_xhr:
         return jsonify(error=_('Sorry,page not found'))
     return render_template("errors/404.html",error=error)
コード例 #2
0
ファイル: __init__.py プロジェクト: zhangst23/tutorial
 def server_error(error):
     if request.is_xhr:
         return jsonify(error=_('Sorry,an error has occurred'))
     return render_template("errors/500.html",error=error)
コード例 #3
0
ファイル: __init__.py プロジェクト: zhangst23/tutorial
 def forbidden(error):
     if request.is_xhr:
         return jsonify(error=_('Sorry,page not allowed'))
     return render_template("errors/403.html",error=error)