Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AttributeError: 'Request' object has no attribute 'body'
- During handling of the above exception, another exception occurred:
- raise RawPostDataException("You cannot access body after reading from request's data stream")
- django.http.request.RawPostDataException: You cannot access body after reading from request's data stream
- @api_view(['POST'])
- def login(request):
- email = request.POST['email']
- password = request.POST['password']
- user = authenticate(email=email, password=password)
- if user is not None:
- login(request)
- print("Breakpoint")
- return Response(status=status.HTTP_200_OK)
- print('something went wrong')
- return Response(status=status.HTTP_401_UNAUTHORIZED)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement