Иван Сушков Иван Сушков - 1 year ago 140
Python Question

How to change error page in Flask?

I have a method, that allowed only post

. When i send send
request, i get a standard error page.

Can i change it or make redirect for another page?

Answer Source

You can use the errorhandler decorator to provide custom handling of a 405 error.

from flask import render_template

def page_not_found(e):
    return render_template('405.html'), 405
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download