Reset Password Verification using Django
  • Reads 1
  • Votes 0
  • Parts 1
  • Time <5 mins
  • Reads 1
  • Votes 0
  • Parts 1
  • Time <5 mins
Ongoing, First published Mar 15, 2022
Following are the ways you can reset your password usnig django through gmail.

After django is intalled you will see settings.py file in your project directory. Scroll down to the last and add following code:
EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend'

EMAIL_HOST='smtp.gmail.com'

EMAIL_PORT=587

EMAIL_USE_TLS=True

EMAIL_HOST_PASSWORD=os.environ.get('EMAIL_PASS')

EMAIL_HOST_USER=os.environ.get('EMAIL_USER')

EMAIL_BACKEND will genereate backend integration of django where the request will reach upon. EMAIL_HOST is the host on which you want to sent your password reset token. EMAIL_PORT for gmail will be used 587 for TLS server where TLS should be tru that allows to interact your Host with your backend. EMAIL_HOST_PASSWORD and EMAIL_HOST_USER are the values that get from environmental variables as you have set it. 
After your settings.py is set,save it and create url patterns for password reset in urls.py file and follow along the following code:
from django.contrib.auth import views as auth_views

urlpatterns={    

path('passwordreset/',auth_views.PasswordResetView.as_view(template_name='user/password_reset.html'),name='password_reset'),

path('passwordreset/done/',auth_views.PasswordResetDoneView.as_view(template_name='user/password_reset_done.html'),name='password_reset_done'),

path('passwordresetconfirm/&lt;uidb64&gt;/&lt;token&gt;',auth_views.PasswordResetConfirmView.as_view(template_name='user/password_reset_confirm.html'),name='password_reset_confirm'),

path('passwordresetcomplete/',auth_views.PasswordResetCompleteView.as_view(template_name='user/password_reset_complete.html'),name='password_reset_complete'),

}

Django itself handles the pasword reset verification by just import the auth from django and calling its classes or modules.
template_name are those html file that will show the password reset forms and confirmation messages so you can render any html file there you have created
All Rights Reserved
Sign up to add Reset Password Verification using Django to your library and receive updates
or
#11django
Content Guidelines
You may also like
Slide 1 of 1
Albatross cover

Albatross

34 parts Complete

Elliot's partner was his whole world, but after Allan's death, his ghost haunts Elliot's dreams. Everyone tells Elliot to move on, but he isn't sure he can. ***** It's been a year since the love of Elliot's life, Allan, passed away. Everyone thinks he should have recovered after that much time, but Allan still haunts Elliot every night. He struggles to maintain relationships with his family, and despite a coworkers interest he can't summon up the courage to date. Elliot is living for the past, because to live for the present means he'll have to live with a hole in his heart. But the question Elliot has to face chases him through his monotonous days: is mourning Allan with everything he has truly living? [[word count: 40,000-50,000 words]]