A
A
Andrey Karpov2020-12-20 12:35:35
Django
Andrey Karpov, 2020-12-20 12:35:35

DRF registration with one Email?

I want to implement registration with a post-request using the following algorithm - an anonymous user sends only email to the endpoint, the function creates a user object (between this, a confirmation code).
The idea is that a user with confirmed mail receives a token and is free to edit the fields of his profile.
I'm using AbstractUser, I've added a confirmation_code field to the model.
So, questions:
1) how to create a user with one email? After all, the model requires username and password
2) how can I write the confirmation code in the model field?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-12-20
@monarch228

Inherit AbstractBaseUser and specify only the required fields.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question