0

I am working on project using Django rest framework,

in this project, we have two types of users:

  1. sales_person
  2. student

I created users app in which types of users

class Student(AbstractUser):
pass

class SalesPerson(AbstractUser):
pass

I need to set AUTH_USER_MODEL in setting file with list such as AUTH_USER_MODEL = ['users.Student', 'users.salesPerson'], but i got this error

ForeignKey(['users.Student', 'users.SalesPerson']) is invalid. First parameter to ForeignKey must be either a model, a model name, or the string 'self'

Any help please?

another question, which best practice to implement multi type of users?

AUTH_USER_MODEL = ['users.Student', 'users.salesPerson'], but i got this error

1 Answers1

0

No. You must go for only one base user, and then inherit that user model and build separate student and salesPerson models from it. Plz check this link for more detail into this issue and how you can resolve it: Multiple Auth User Models

Maz
  • 69
  • 4