Reset Password Veri...
By kodblemscom
1
0
0
  • General Fiction
  • django

Description

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/<uidb64>/<token>',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

UntitlReset Password Verification using Django ed Part 1

Continue Reading on Wattpad
Reset Pas...
by kodblemscom
1
0
0
Wattpad