简体   繁体   中英

Example.com in django password reset

I have set up my django project to enable password reset but when the password reset mail is sent, i get the line https://example.com/accounts/reset/Mg/ ... . Exampple.com is not in any way related to my site. I have tried to remove it such that it reads my site url but to no avail

I have changed the site domain name in the admin site apps, example.com has been replaced with site url.

For future reference, django contrib auth uses current site domain provided by Site model in django.contrib.sites.models.

To check which one do U have configured, enter into the shell with the desired settings and type:

from django.contrib.sites.models import Site
current_site = Site.objects.get_current()
print(current_site.domain)

This will show what domain will be used to construct absolute links like in this case, to reset the password.

Check admin. You can see site domain in 'Sites'. Default of the site domain is 'example.com', so if you change the site domain to your domain, you can resolve it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM