Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. @api_view(['GET'])
  2. def current_user(request):
  3.     serializer = UserSerializer(request.user)
  4.     return Response(serializer.data)
  5.  
  6. """
  7. When I go to 127.0.0.1:8000/rest-auth/current_user via browser it shows me as authenticated
  8. But when I visit the same url via react it doesn't show that user is logged in
  9. I can pass token to this url but I'm not sure if Django stores tokens for each user?
  10. """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement