Home > Net >  how to retrieve the token generated while using django allauth and django-rest-auth with django rest
how to retrieve the token generated while using django allauth and django-rest-auth with django rest

Time:09-27

I am using django allauth and django-rest-auth from this tutorial to generate a token for django rest framework. The tutorial can be found on this page, at the bottom. (enter image description here

enter image description here

Now the issue is that i am on python3 manage.py shell and i am trying to retrieve any of the token generated for either user test001 or test002

does any one know how to do it? I am having a hardtime to achieve it

Thanks in advance

CodePudding user response:

tokens_for_user1_and_user2 = APIToken.objects.filter(user__name__in=["test001","test002"]).all()

I guess ... or something like that

  • Related