Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password Reset Via Email Implimented #3

Merged
merged 2 commits into from
Oct 8, 2021

Conversation

mvvsmk
Copy link
Contributor

@mvvsmk mvvsmk commented Oct 7, 2021

This is a pull request for #2 issue for the password reset via email:
Changes Done

  • Moved all the url patterns pertaining to the password reset to the urls.py of main EasyShop/urls.py
    - As these urls are moved to the EasyShop.py you can refer to them simply as {% url 'password-reset' %}etc,
  • Edditted formating of the following pages , to make them work in sync
  • removed redundant success urls
  • moved passwordchange.html as it was in the wrong directory
  • This app now uses a physicall gmail account to send mails, if you want it for other email hosts you will have to change EMAIL_HOSTin your settings.py

This implimentaion of mail reset funtion physically sends a mail from a gamil account , for the testing purposes I used my own email(gmail) to send reset email:

How to configure:

In settings.py

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

These are the email and password of that email used to send the mails, here both of them are enviornment variables of my system
You can learn how to set enviornment variables and hide sensitive info here (this is a guide for linux/mac, you can search one from youtube for windows)

NOTE: here the password used is an app password as my account has 2 step verification (which I highly recomend using) and a you can see how to set them up here.You can use a less secure method too by going to your google settings here.You can read about it here.When using the less secure app method configure your 'EMAIL_PASS' to the actual password of the gmail account you are going to use.

If all things are configured correctly without errors and still the mail is not being sent, check the email enterd once if the email enterd in the form doesn't match any email in the database django would not send the email.

**PS : ** I am participating in the hacktoberfest event , could you please approve it.
A pull request can be approved either by giving it an overall approving review from maintainers, or by merging the pull request, or adding the 'hacktoberfest-accepted' label .

@mvvsmk mvvsmk mentioned this pull request Oct 7, 2021
@HarshKumarChoudary HarshKumarChoudary merged commit a10c109 into HarshKumarChoudary:main Oct 8, 2021
@HarshKumarChoudary
Copy link
Owner

Merged the work. Thanks for your contribution. Closing the PR.

@HarshKumarChoudary HarshKumarChoudary linked an issue Oct 8, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Email Password Reset
2 participants