title: Django: "django.http.request.RawPostDataException: You cannot access body after reading from request's data stream"
body: <p>I keep getting an error every time I try to log this user in. Here are the relevant tracebacks:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>This is inside my views.py:</p>
  
  <pre><code>@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)
  </code></pre>