Tuesday, May 25, 2021

Re: help on autologging users after signup

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 tosina...@gmail.com wrote:
image.png
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 <jonind...@gmail.com> 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 tosina...@gmail.com wrote:

I've tried that it didn't wrk

On 24 May 2021 05:21, "lalit suthar" <sutharl...@gmail.com> 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 tosina...@gmail.com 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.png
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 django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a3a45860-b65c-45f0-9c24-cd23165e5048n%40googlegroups.com.

--
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 django-users...@googlegroups.com.

--
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 django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/75b1f89b-8338-46e6-9aab-5d51b8734fbfn%40googlegroups.com.

No comments:

Post a Comment