Category: Django-REST

Customizing Object Level Permissions – Django REST Framework

In this article, we will discuss how to customize Object Level Permissions in Django REST Framework. To customize permission classes in Django REST Framework, we should inherit the rest_framework.permissions.BasePermission class and implement either or both of the following methods:.has_permission(self, request, view).has_object_permission(self, request, view, obj)If we look at our robot model mentioned in Browsable API in […]

Continue Reading

Customizing Filters in Django REST Framework

Prerequisite: Adding Filtering in APIs – Django REST Framework [lin needed article on published yet]Django filters facilitate filtering the queryset to retrieve the relevant results based on the values assigned to the filter fields. But, what if the user wants to retrieve details within a given range. Say, for example, the user needs to fetch detail […]

Continue Reading