Django 
allows<https://docs.djangoproject.com/en/1.5/topics/http/views/#customizing-error-views>users
 to define handlers to some exceptions, most notably http404, server 
error (status 500) and permission denied (status 403).

I here propose this feature to be extended to 
HttpResponseNotAllowed<https://docs.djangoproject.com/en/1.5/ref/request-response/#django.http.HttpResponseNotAllowed>
 (status 
405).

There main reason is consistency: if django has a way to create such 
status, it should also allow the developer to handle them.

For instance, I was planning to write handlers for some status I raise in 
views (mainly for debugging during live), and I'm not being able to use the 
decorator 
require_http_methods<https://docs.djangoproject.com/en/1.5/topics/http/decorators/#django.views.decorators.http.require_http_methods>
 because 
it emits a status that I cannot handle by myself. Thus, I cannot properly 
judge if it was triggered by a server semantic error or by a "curious" user.

Regards,
Jorge

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" 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.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to