About Forbidden Access
In a Django view, when a user does not have permission to modify an object, raise the PermissionDenied
exception:
1 2 |
|
You can customize its output in the template 403.html
.
If you want a custom content for that specific error message, return HttpResponseForbidden()
instead:
1 2 |
|
Tips and Tricks User Experience Django 4.2 Django 3.2 Django 2.2
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.