K
K
KIN19912017-07-24 07:58:24
Django
KIN1991, 2017-07-24 07:58:24

What is the best way to implement user registration in Django?

Good afternoon, there is a need in one project to implement user registration / authorization, I'm interested in best practice , how best to organize this business? Use a custom Django user model and store site users (they don't and can't have access to the admin panel) along with admin users? Or do a separate model for site users?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Animkim, 2017-07-24
@KIN1991

Well, my answer is, if the project is new, then God himself ordered to use the method described in the doc:
https://docs.djangoproject.com/en/1.11/topics/auth...

A
Artyom Belousov, 2017-07-24
@flygrounder

It would be nice to create your own user model, but include not all User fields there, but those that are not in it and add OneToOne, thus linking your model with the standard one.
Advantages of this approach:
1. DRY you do not repeat what has already been written
2. You can use standard authentication tools, as well as password hashing, and not write it yourself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question