D
D
Deleting Account2019-10-04 19:15:05
Django
Deleting Account, 2019-10-04 19:15:05

Django 2. How to add additional fields during registration, and make it possible to create users of 2-3 types (with different set of rights)?

How to make it so that when registering on the site you can choose the type of user that suits you. For example, a buyer or an entrepreneur, a teacher or a student. How to add additional fields in this case, because the fields that need to be filled in will change depending on what type of user account you need to create. In this case, in any case, there will be additional fields that need to be filled in by any type of user, for example, such fields as: email, name, sername, fathername, phone. And when using the UserCreationForm class, in the user creation form, it is possible to enter only your name and password to enter your account.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
szelga, 2019-10-04
@Andriy_Kosmenyuk

for each type, make a model with additional data and a OneToOne relationship per user. forms and representations to do, probably, manually. I would do so.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question