Using Password Recovery system in django.contrib.auth through email
In my Django project I am trying to use user password management as provided in django.contrib.auth
.
My set up works as expected (and as explained in Django docs) except: password recovery through Email, when the sites options (django.contrib.sites
and SITE_ID
) are added in settings.py.
Before adding the sites options, the password recovery "link" (received in terminal console) would be something like:
http://127.0.0.1:8000/reset/MQ/xxx123-11111a0c4a6czz43b314b089a544v666hhh2/
In the this instance (sites options are not added), using the link brings up the Password reset
page as expected.
However, after the sites options are added, the link received changes to be:
http://example.com/reset/MQ/xxx123-11111a0c4a6czz43b314b089a544v666hhh2/
In the 2nd instance (i.e. received link starting with domain example.com
), the password reset
page does not show up (browser issues a message: No internet).
If sites domain and name field values are changed (in Admin) and changed to say, xyz.com
; the link received changes to:
http://<domain>/reset/MQ/xxx123-11111a0c4a6czz43b314b089a544v666hhh2/
and in this case also, the Password reset
page fails to show up (with a message like):
`This site can’t be reached`
As the process for implementing password recovery is well documented, I am not adding them here.
My question is:
Why does the recovery system fails when sites
options are added to settings.py? Is it possible to use the email recovery link with the domain names (as described above) to bring up the Password reset
page?
If yes, what do I need to do to achieve that?