How to verify users email with token generator link for signup in django webapp

Viewed 465

I am doing a web app in Django. I hardly tried to create a TokenGenerator for verifying the user's email to activate the user's account

coming to the problem,

  1. how to send the verification email to the user account while signup. while signup, users can receive a verification link email with a token generator

  2. the user has to input the password at the time of account signup

  3. After verifying the email user can log in to the respective page via their mail id and password

  4. while login it should check whether an email is present in the DB (DB will be updated with user emails )

1 Answers

for the first question, Django has built-in functions and classes for sending emails, you can check them here: https://docs.djangoproject.com/en/3.2/topics/email/ and this post will help you send and email: https://dev.to/yash2115/how-to-send-e-mail-in-django-37ge, and if you want sen an email for any user's sign up you have to use signals, check it here: https://docs.djangoproject.com/en/3.2/ref/signals/
other questions are all related and they are pre-built in Django, these links will help you:
https://learndjango.com/tutorials/django-login-and-logout-tutorial
https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Authentication

repositories which may help:

Related