Created
May 12, 2020 20:14
-
-
Save ph00lt0/208432ff6da9d2832d7437e6251d10b6 to your computer and use it in GitHub Desktop.
Force authenticated Django Rest Framework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user = User.objects.get(username='lauren') | |
client = APIClient() | |
client.force_authenticate(user=user) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment