mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
Fix token param in force_authenticate example
related_name for Token is `auth_token`, not `token`.
This commit is contained in:
parent
2d4226c2bd
commit
1b24199778
|
@ -82,7 +82,7 @@ For example, when forcibly authenticating using a token, you might do something
|
||||||
|
|
||||||
user = User.objects.get(username='olivia')
|
user = User.objects.get(username='olivia')
|
||||||
request = factory.get('/accounts/django-superstars/')
|
request = factory.get('/accounts/django-superstars/')
|
||||||
force_authenticate(request, user=user, token=user.token)
|
force_authenticate(request, user=user, token=user.auth_token)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user