It is not returning the "login success" message because you are using `APIView` parent class and that does not have create() method so your code inside create() won't get executed. You have to move that code to post() method. https://www.cdrf.co/ is a good reference to find out different Parent class's and their supported methods.
On Tuesday, 25 May 2021 at 12:15:57 UTC+5:30 [email protected] wrote: > [image: image.png] > [image: image.png] > > > so this is it, i've tried it, but still returning id of null > and it not returning the login success msg > > On Mon, May 24, 2021 at 9:08 PM I,M& M <[email protected]> wrote: > >> in drf, the request.POST dictionary does not contain the body of the >> request instead use the request.data to access the requests body. >> ex. >> email = request.data.get('email') >> password= request.data.get('password') >> new_user = authenticate(request, email, password) >> request.data contains the username and password >> >> On Monday, May 24, 2021 at 9:29:33 AM UTC+3 [email protected] wrote: >> >>> I've tried that it didn't wrk >>> On 24 May 2021 05:21, "lalit suthar" <[email protected]> wrote: >>> >>>> in authenticate function take values from request.data dictionary >>>> email = request.data.get('email') >>>> poassword = request.data.get('password') >>>> On Sunday, 23 May 2021 at 07:27:51 UTC+5:30 [email protected] wrote: >>>> >>>>> halo guys, i wan make it possible for user to auto login user after >>>>> signup in my app using drf >>>>> but still getting null as d user-id & returning anonymous user err >>>>> can anyone help out >>>>> [image: image.png] >>>>> [image: image.png] >>>>> >>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Django users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/django-users/a3a45860-b65c-45f0-9c24-cd23165e5048n%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/django-users/a3a45860-b65c-45f0-9c24-cd23165e5048n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/cfbe09d9-00b9-4993-abc2-a3a87846d8e7n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/cfbe09d9-00b9-4993-abc2-a3a87846d8e7n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/75b1f89b-8338-46e6-9aab-5d51b8734fbfn%40googlegroups.com.

