Skip to main content
2 votes
1 answer
47 views

I'm using DRF and NextJS(app router) to build an application with a search feature that saves the authenticated user's search history. The search history is their search terms with a timestamp and ...
user3125823's user avatar
  • 1,958
0 votes
1 answer
50 views

I have created a viewset for authentication. Since this is the authentication viewset, I want this viewset to be accessible to unauthorized users as well. Following DRF documentation, this is what I ...
U. Watt's user avatar
  • 794
1 vote
1 answer
55 views

I have a class based APIVIEW and I want to prevent a normal user (isstaff=false, is_superuser=false) from creating a customer. class CustomerPageView(APIView): # permission_required = 'api....
lolideppt's user avatar
0 votes
2 answers
150 views

I'm starting to write tests for my endpoint, "categories/", and I can't get past a custom permission that I have added to the view that is being tested. In this permission, it checks the ...
JDiamond's user avatar
1 vote
0 answers
209 views

I have a Django REST framework viewset with multiple actions such as list, create, and more. When I send a GET request, I noticed that some actions are executed multiple times, and the action is ...
Hamidreza Farzin's user avatar
0 votes
1 answer
1k views

I have a Django REST_framework api and I have a UserViewSet class. For this view set I would like that anyone reaching the url can use the post method of the Viewset but cannot see all the users ...
pacdev's user avatar
  • 591
3 votes
1 answer
2k views

I'm building an API using Django Rest Framework (DRF) and I'm facing an issue with rate limiting. Specifically, I need to set different rate limits for different types of users: Staff members: 1000 ...
sidharth's user avatar
  • 101
0 votes
1 answer
51 views

I have a model with field instances and have views. Can i make so that when you redirect to to main page you can see only ID, title, deadline, done? But when you redirect to the detail page you can ...
Ulan's user avatar
  • 31
1 vote
2 answers
323 views

In this code, only the author of the post can edit his post. How can it also be made so that each author can see only his posts? from rest_framework import permissions class IsAuthorOrReadOnly(...
Ulan's user avatar
  • 31
0 votes
1 answer
1k views

I've got a tiny function that just looks to get a response from my DRF API Endpoint. My DRF settings look like this: "DEFAULT_AUTHENTICATION_CLASSES": [ # Enabling this it will ...
Hanny's user avatar
  • 722
51 votes
5 answers
30k views

I am confused with the BasePermission in Django-rest-framework. Here I defined a class: IsAuthenticatedAndOwner. class IsAuthenticatedAndOwner(BasePermission): message = 'You must be the owner of ...
M1nt_zwy's user avatar
  • 937
34 votes
5 answers
36k views

I am using Django REST Framework to access a resource 'user'. As user information is personal, I do not want a GET request to list every user on the system, UNLESS they are an admin. If the user ...
user1830568's user avatar