the view is @api_view(['POST']) def example(request): return Response({'usernmae': request.user.username},status=status.HTTP_200_OK)
when i print the content of response object it shows b'{"detail":"CSRF Failed: CSRF cookie not set."}' it happens only when i set sessionid cookie in client side On Monday, September 19, 2016 at 1:34:58 AM UTC+5:30, James Schneider wrote: > > On Sep 18, 2016 12:56 PM, "sabari rangan" <sabari....@gmail.com > <javascript:>> wrote: > > > > i am using django.contrib.auth module for authentication system in my > django rest framework app, when i post data i couldn't able to authenticate > the user it return 403 response code . but during get request it works > fine. i have attached the sessionid in cookies in both above. kindly help > me with this i got stuck. > > > > Can you post the relevant Django views for the GET and POST requests? > > -James > -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/74c79247-46d3-4b8b-9ed5-e195d646bd53%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.