1👍
✅
The trouble is, you are not raising a 403 exception (as you did for the 404), but simply returning a response with a status code of 403. As the docs show, you need to raise django.views.defaults.permission_denied
to trigger the 403 page.
from django.core.exceptions import PermissionDenied
...
raise PermissionDenied
Source:stackexchange.com