Reputation: 105
I have a method, that allowed only post requests
. When i send send get
request, i get a standard error page.
Can i change it or make redirect for another page?
Upvotes: 0
Views: 278
Reputation: 65430
You can use the errorhandler
decorator to provide custom handling of a 405 error.
from flask import render_template
@app.errorhandler(405)
def page_not_found(e):
return render_template('405.html'), 405
Upvotes: 1