1
  1. I am using Django oauth toolkit to implement Oauth in my application.
  2. I am already having a user model, but i want to use some other user model which is not AUTH_USER_MODEL.
  3. What i can see now is that i can only extend all the models and use my user instead of the AUTH_USER_MODEL, but i would like to know what will be the shortest and cleanest way to implement a separate user model in django oauth toolkit

Current implementation is

user = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True,
                         on_delete=models.CASCADE)

I want to use a separate AUTH_USER_MODEL

Ezio
  • 723
  • 6
  • 14
  • The [documentation on custom user models](https://docs.djangoproject.com/en/2.1/topics/auth/customizing/#substituting-a-custom-user-model) is pretty good. There's only one bit regarding multiple user models, and it does not look very clean; you should probably reconsider this approach and separate out the non-matching fields, e.g. [using a Profile-style one-to-one model](https://docs.djangoproject.com/en/2.1/topics/auth/customizing/#extending-the-existing-user-model). – kungphu Nov 05 '18 at 02:05
  • Basically i can create multiple user models, but AUTH_USER will always be one – Ezio Nov 05 '18 at 08:45
  • Django oauth toolkit is using oauth user from AUTH_USER setting as foreign key so i dont want to use the AUTH_USER, i want to use some other user model – Ezio Nov 05 '18 at 09:12

0 Answers0