How do I raise a Response Forbidden in django

I’d like to do the following:

raise HttpResponseForbidden()

But I get the error:

exceptions must be old-style classes or derived from BaseException, not HttpResponseForbidden

How should I do this?

4 Answers
4

Leave a Comment