> > Also, it's not really documented anywhere and because it's outside of http > module, it's hard to find on your own. >
bingo, that's exactly the point and that's why a more intuitive and expected Http403 would be nice, you will know where to find it and you will know what it's supposed to do. returns http.HttpResponseForbidden which is almost never what you actually > want to return to the user > that's not true, at least no more than a 404/500 which you also return and have templates for; 403 is a perfectly valid response in fact django's trac uses it too via apache auth and it doesn't even have a nice template just the default apache error. also a 403 can be used for webservices or any other places where you can't return a redirect to the login. anyway I think it would be nice to have it, even if it just inherits from django.core.exceptions. PermissionDenied but it's just my opinion not a real problem. 2010/6/28 Łukasz Rekucki <lreku...@gmail.com> > On 28 June 2010 18:17, Tom Evans <tevans...@googlemail.com> wrote: > > On Mon, Jun 28, 2010 at 5:13 PM, Michael Cetrulo <mail2sa...@gmail.com> > wrote: > >> that's incorrect, we're talking about exceptions that go back as status > >> codes not internals for the application itself. > >> > > > > django.core.exceptions.PermissionDenied is caught by > > BaseHandler::get_response() and converts it into a > > HttpResponseForbidden (django/core/handlers/base.py + 134) > And it returns http.HttpResponseForbidden('<h1>Permission > denied</h1>'), which is almost never what you actually want to return > to the user. Relevant ticket: > http://code.djangoproject.com/ticket/5515. Also, it's not really > documented anywhere and because it's outside of http module, it's hard > to find on your own. > > -- > Łukasz Rekucki > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" group. > To post to this group, send email to django-develop...@googlegroups.com. > To unsubscribe from this group, send email to > django-developers+unsubscr...@googlegroups.com<django-developers%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/django-developers?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.