13

I'd like to use django-rest-auth to easily make use of the registration and social auth features of django-allauth in my API.

I'd also like to use django-rest-knox, as it provides a token per device, rather than per user.

When creating a user via django-rest-auth, it tries to create and return a token. This fails, as it needs to use django-rest-knox to generate the token, but I'm unclear on how to do this. Is it possible to get these two packages working together?

Thanks!

StringsOnFire
  • 2,726
  • 5
  • 28
  • 50
  • I haven't done this myself yet but maybe http://stackoverflow.com/questions/29939042/drf-how-to-integrate-django-rest-framework-jwt-to-djoser can be a starting point. I'm looking to do the same thing as you too – mithril Mar 01 '17 at 16:01
  • 2
    I've seen that, wasn't helpful, made a PR on django-rest-auth for this but it's been sitting for a while without review. If you comment on that it might get some notice! – StringsOnFire Mar 01 '17 at 16:03
  • @StringsOnFire The original django-rest-auth is no longer supported. Please consider using the fork: https://github.com/iMerica/dj-rest-auth – mariodev Jul 09 '22 at 19:22

1 Answers1

-1

I suggest that instead of using these two packages together, use dj-rest-auth (django-rest-auth is deprecated). Then, try to implement the logic you need for generating tokens for each device. As you said in your comments, try to make a PR and only work with one of these packages. I know I did not kinda answered your question, but I felt that this should be the correct answer.