A
A
Artyom Innokentiev2015-12-21 23:34:38
Django
Artyom Innokentiev, 2015-12-21 23:34:38

How to do 2 factor registration?

I tried to install django-registrationand django-registration-redux- nothing happened to me.
The User model is custom, I did not find any documentation with examples, django-registrationexplanations django-registration-redux.
In general, is there any difference between these packages?
Upset, thinking, maybe it’s worth writing it yourself (in fact, you just need to generate a key, save it, send the user an email with a link containing the key, activate the account when clicking on the link)?
Advise plz how to be: try to start django-registrationor write yourself.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2015-12-21
@artinnok

There's writing for 5 minutes. You create a model with three fields: user (FK), some hash of something (yes, at least a random string), creation time (auto_now_add). When registering, you generate this model, and when you follow the link, you give the user is_active=True. You create a management command by running a cron once a day, which will clean up users (and this new model) who have not activated their account for, say, 3 days. Do not forget unique=True to hang up on the user and on hash.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question