Django Password Reset Email in PythonAnywhere
HomePythonOther

Django Password Reset Email in PythonAnywhere

Django is the popular web development framework of python. As per the record of github django users in July 2019 is 274,837 and as per the s...

Streamlining Software Development: A Guide to CI/CD with Jenkins
Accident Detection And Alert System

Django is the popular web development framework of python. As per the record of github django users in July 2019 is 274,837 and as per the stackoverflow 202,768 questions asked related to django and one of them is about error on password reset email while deployed in pythonanywhere.



Well you can use either gmail smtp server or sendgrip for pythonanywhere for password reset with email. 

Above is for gmail SMTP server and below one is for sendgrid.

Process for password reset by sending email in django

  1. Setting
  2. Templates
  3. Views
  4. Urls

Setting
Add above sendgrid code into your setting. For this visit sendgrid link and register then use smtp service. It ask you to create api key, for that write your api key name and click on generate api key then then key is provided to you.

Templates
You have to make four html and one txt file. These templates are used to render the forms and message related password reset and a text file contain the email subject text.

For password reset form make password_reset_form.html

For sending email make password_reset_email.html In this file change the url “custom_auth:password_reset_confirm” as per your project url.

For subject of the email make password_reset_subject.txt Inside it write email subject like “Password Reset”

Then make password_reset_done.html which display reset done message

Make password_reset_confirm.html too. This is used to set new password.

View
We are going to implement class base view to reset password and we have to make three view class.

For password_reset view

For displaying reset done message

For set new password and confirm

Urls
These urls must set in urls.py for communication between django view and templates. It defines where to go while clicking the links. Note do not change the <uidb64> if changed may generate error.

After completing all these steps and process now push the code into git and pull in pythonanywhere via its bash console. Here you go run your site and reset you password hyy hyy enter correct email address otherwise you won’t receive email. 😉 😉 😉
Have fun!!!

Loading...
Name

Accident Alert,1,AI,2,Array,1,Aurdino,1,C,2,Computer Graphics,9,Data Science,3,Dataset,1,Decoratot,1,Django,1,ESP32,1,Fixed point/iteration method,1,Greater or smaller,1,html,1,Image Processing,1,JAVA,1,Javascript,22,Machine Learning,1,Matlab,3,Numerical Method,13,OOP,1,Other,3,PHP,1,Point operation,1,Python,11,Raspberry pi,1,Recommendation System,1,Regression,1,Reservation System,1,Robotics,1,Simulation,2,sine wave,1,String Handling Function,1,Web scrap,1,Webpage,1,
ltr
item
COMPUTER PROGRAMMING: Django Password Reset Email in PythonAnywhere
Django Password Reset Email in PythonAnywhere
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwYnHWh-w6nE0vo8bM3gmPJaM0cogh4XxKqMxg0psU06eG5SdTeBEkrx1B0gkQ-wqUdL9pChuH3xkBMyzF_30Ps0ZMfTBRZ-tE1MhOlxrJ0izY4oh4fAHIMnw49cG3NNILEHEbJfuEV4Ln/s320/password_reset_form_custom.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwYnHWh-w6nE0vo8bM3gmPJaM0cogh4XxKqMxg0psU06eG5SdTeBEkrx1B0gkQ-wqUdL9pChuH3xkBMyzF_30Ps0ZMfTBRZ-tE1MhOlxrJ0izY4oh4fAHIMnw49cG3NNILEHEbJfuEV4Ln/s72-c/password_reset_form_custom.png
COMPUTER PROGRAMMING
https://computerprogram4ru.blogspot.com/2020/03/django-password-reset-email-in.html
https://computerprogram4ru.blogspot.com/
https://computerprogram4ru.blogspot.com/
https://computerprogram4ru.blogspot.com/2020/03/django-password-reset-email-in.html
true
8672391763020279633
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy