My question is simple, how do I display a custom error page for HTTP status 405 (method not allowed) in Django when using the @require_POST
decorator?
I'm using the django.views.decorators.http.require_POST
decorator, and when the page is visited by GET request, the console shows a 405 error, but the page is just blank (not even a Django error page). How do I get Django to display a custom and/or default error page for this kind of error?
EDIT:
It's worth mentioning that I've tried putting a 404.html, 500.html and 405.html page in my templates folder - but that does not help either. I have also varied between DEBUG = True
and False
, to no avail.