How to implement 3 user types for Django

Hello.

If l have 3 user types, let's say a normal user, a student and a teacher. How can l allow each to register in the user table, so that each can login to the system?

 

You can add an account_type field to the User model with the choices normal, student and teacher, then let them select an account type when registering

and  check this link out

 They shouldn't be able to select the account type. Reason is: a random person can just come to register as a teacher.

The best way to go about this is to have a separate registration form for the teacher. The teacher account would be created by the admin while the admin would be created by the super admin.

After the creation of the teacher account, then the details is given to the teacher so as to login.
And don't forget to give each of them a privilege_id so as to specify their permission

 

Django Replies 0 Views 138 Users 0

Suggested Topics

Django Updated on April 1, 2020, 9:12 p.m. Replies Views 55

Django Updated on April 6, 2020, 12:50 a.m. Replies Views 42

Django Updated on April 7, 2020, 9:54 p.m. Replies Views 73

Django Updated on April 13, 2020, 11:35 a.m. Replies Views 143