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?
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?
Try this Way , sending message with Error
from django.core.exceptions import PermissionDenied
raise PermissionDenied("You do not have permission to Enter Clients in Other Company, Be Careful")