S
S
Socrates2018-02-01 15:03:20
Django
Socrates, 2018-02-01 15:03:20

Registration confirmation via email?

There is a registration system, everything works well, it is necessary to confirm registration through a random link sent to the new user's mail.
Are there any tips or examples for this task?
there is an idea to generate random characters, make a link to it with a regular expression in the urls, then process it in the view, such as take the url randomly from the request, compare it with the urls of all users, is there a match? is_active: true.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2018-02-01
@Karmov69

https://github.com/django/django/blob/master/djang...

def get_random_string(length=12,
                      allowed_chars='abcdefghijklmnopqrstuvwxyz'
                                    'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'):

Save the hash in the user session and check
Or save it in the database and check the hash and the user at the same time

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question