nginx + uwsgi + flask - disabling custom error pages

后端 未结 3 1618
-上瘾入骨i
-上瘾入骨i 2021-01-11 20:09

Is it possible to disable nginx\'s custom error pages - if I may call them that - to display my framework\'s exception pages?

I can\'t really see my werkzeug debugge

3条回答
  •  星月不相逢
    2021-01-11 20:51

    Use Flask#errorhandler to register your own error handlers in flask. For example to replace the 404 you would do something like:

    app = Flask()
    
    @app.errorhandler(404)
    def handel_404(error):
        return render_template('404.html')
    

提交回复
热议问题