I am building an app using django rest framework and react. I have installed rest auth, all auth for user authentication. When i create a super user from console using manage.py createsuperuser or manually add from django admin panel then i can login from route 'rest-auth/login' & get a generated token. But now i want add a different user called Doctor who can access limited features.I want to register the doctor user from django admin. But here i want to register the doctor by only email address & password not user name & password. So the question is how to make a custom user called doctor in django rest framework. Last thing, i have no user model in models.py cause django rest auth handling all staff about user.Important thing is i want to differ all users by email & user name. If i get the user by username & password then i will assume it as a hospital owner & if i can login using email & password then it will be a doctor.
Asked
Active
Viewed 888 times
1 Answers
0
First, create your custom user model, it has been always recommended to go with your custom user model.
If you are in the beginning of your project it will be easy to do it, if not follow this
Considering your roles, check this it may be helpful.

Mahmoud Adel
- 1,262
- 2
- 13
- 23