I'm coding a application in Django where there are 2 types of users that need to login on the webapplication: teachers and students. Now I'm not sure what is the best approach for this. I already read a lot of tutorials and Stackoverflow questions that explains how to extend the user model, but I'm not sure which is the best option.
The requirements:
- 2 kind of profiles with different fields needed (teacher and student)
- Possibility to have separate admin "objects" where the superstaff of the application can login in the backend and manage the separate objects.
Option 1:
Make use of the method to extend the AbstractUser class. This works for now, however I don't know if I can use AUTH_USER_MODEL twice (teacher and student). Now it's one profile with both fields for students and teachers. With proxy models I can show only the necessary fields for teachers or students.
Option 2: (I think this is the best solution)
Make 2 models (Teacher and Student) with each a Foreignkey to User (OneToOneField). Problem here is that if the Administrator of the website creates a new teacher or student, they also need to create a separate user first (that can login) and then link it when creating the teacher or student. (I can solve this with signals I think).
Which is the best approach / best practice for this situation?