On Fri, Oct 3, 2014 at 10:17 PM, Poorbahrdew .poorbahrdew <[email protected]> wrote: > Hi guys, > > I know, this is a quite old thread, but recently I had the same issue with > these decorators for the same reason: how to handle 405 responses in user > friendly way? > > I have found a simple solution which doesn't require to write your own > middleware and I want to share it with people facing the same problem in the > future :).
In my original response last year, I was trying to explain that this is handled by middleware, not that you have to handle it with your own custom middleware. I then listed out the error handlers that django provides, noting that handler500 will handle *all uncaught exceptions*. Therefore, if you want to do something special with a particular exception, like a custom exception like HttpMethodNotAllowed, you can catch this with a custom handler500 and handle it there. No patching of views required. Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAFHbX1KKrPkorj-zB3OBD80A4bvR%3DWAxWwyc3W9%3DbGye7WFO-w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
