D
D
Deleting Account2019-10-06 16:48:15
Django
Deleting Account, 2019-10-06 16:48:15

Django 2. How to add a user to the user group of their choice when registering?

There are user groups: such as teacher, student, simple user.
How to make it so that a visitor, when creating an account, can select a group to which he needs to be added when creating a user.
I should note that there are other user groups, such as Moderators, Administrators, and others, to which in no case can you add anyone. That is, this procedure must be done as safely as possible!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-10-06
@Andriy_Kosmenyuk

Add a field containing a set of allowed groups to the registration form, and add the user to the selected group in the view that processes this form .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question