T
T
TheProphet2017-02-14 19:47:49
Django
TheProphet, 2017-02-14 19:47:49

How in django to implement registration via email / phone of the user's choice?

This is actually the question. Already searched a lot and found either through email, or through the phone and SMS.
And it is necessary for the choice of the user, while I do not need username as such. And then the question is what to do with USERNAME_FIELD, if it can be an email field, or maybe a phone, depending on the situation.
There is an idea to use GUID .
Or even make a username field and duplicate mail or phone number according to the situation. But something seems to me this is nonsense.
Of course, the user model has its own, we inherit from AbstractBaseUser and PermissionsMixin. I am writing in django 1.10.
What do you advise? Maybe there are some links (if there is better in Russian).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita Konin, 2017-02-14
@TheProphet

I assigned USERNAME_FIELD to the email_or_phone field, which was a string.
Plus there were just email and phone fields.
True, you will most likely have to write the registration logic yourself, and use third-party Django apps only to perform tasks like email confirmation and sending SMS messages

U
un1t, 2017-02-14
@un1t

I would make separate email and phone fields, and you can push at least a random string into the username

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question