Skip to main content
0 votes
1 answer
63 views

I have a social network project for users to share their recipes. The Recipe objects managed by a ViewSet, which has Serializer, where create and update recipes operations defined, via POST and PATCH ...
user30835942's user avatar
0 votes
2 answers
128 views

I am using Django with rest framework. Sign Up works fine, but when I log in, after passing the email and password to the backend, the authenticate() returns None even if the credentials are right. I ...
user23033721's user avatar
0 votes
0 answers
74 views

I am trying to combine multiple serializers into a single API call, and as a result, I am using viewsets.ViewSet. I am aware that viewsets.ModelViewSet automatically generates the routes, but with ...
PhilM's user avatar
  • 415
0 votes
1 answer
82 views

I have two Blog API's in Django Rest Framework. One uses Django's default User model whilst the other uses a CustomUser. Authentication works well in both cases. I have similar serializers, viewsets ...
Uchenna Adubasim's user avatar
1 vote
0 answers
55 views

I have ModelViewSet view in django rest framework project. I am trying to filter documents that are not live, I mean are not on main view. To filter I am using params: http://localhost:8000/documents?...
user25455142's user avatar
1 vote
2 answers
58 views

I'm trying to overwrite the response that is sended by django when create a new object. I need to return only the primary key of the created object instead the whole object. The function that I'm ...
Step's user avatar
  • 149
0 votes
1 answer
38 views

I have a Business model and Order model. Businesses can order furniture in our website. A user creates an account and makes an order. Since he is a new user, he is not associated to any Business. In ...
Vinay Stark's user avatar
0 votes
2 answers
78 views

I am trying to write a login view in django restframe work to authenticate a user into the application but each time I send a request to the server I keep getting this error `{ 'email': ['email ...
kelani darasimi's user avatar
0 votes
1 answer
400 views

I just started learning about DRF. We know that with generics and mixin Django REST Framework makes handling GET, POST, PUT, DELETE etc easy for users. And another feature is ViewSets. It helps us to ...
Mosleh Uddin Asad's user avatar
1 vote
1 answer
312 views

I'm designing an api using python DRF for a merchant profile page. ID should not be required to be passed into the api. I'm trying to do a simple fetch to get one object to return as a result and I ...
henry's user avatar
  • 31
1 vote
1 answer
33 views

I am hitting a KeyError for 'children' when I run this create() function: class TaskViewSet(ModelViewSet): queryset = Task.objects.all() serializer_class = TaskSerializer def create(self, ...
Adam Starrh's user avatar
  • 6,998
0 votes
1 answer
160 views

I see in a bunch of django code, especially in viewsets, that when serializer is initialized like the following: class UserViewSet(viewsets.ModelViewSet): """ A viewset that ...
bohorqux1996's user avatar
0 votes
1 answer
99 views

Often I wish to use the created/updated object, for say to log it in some history, or use it in an email. E.g.1. CreateAPIView def create(self, request, *args, **kwargs): ret = super()....
run_the_race's user avatar
  • 2,550
0 votes
2 answers
60 views

I am trying to create a CustomUserViewset, and add a login_user api to it. The problem is that although I set the permission_classes to AllowAny, still when calling the login_user api, it says: {"...
Vahid's user avatar
  • 417
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

15 30 50 per page
1
2 3 4 5
25