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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.