I am using the django inbuilt auth urls and views for the user login/logout/passwordreset/
namely, in the urlpatterns
url(r'^accounts/', include('django.contrib.auth.urls')),
in my views.py
from django.contrib.auth.views import *
after enter the email address for resetting password, I could receive the email with the link to reset password, but the link would be similar to http://example.com/accounts/reset/s-3is-7535266db5af311b2a02/
and after manually change the 'example.com' to my IP address(as I am running the server on my localhost), I could change the password as well as login with the new password.
I have read the Django auth codes and understand that if no override given, it would take domain of the current site and set it as'domain' in the PasswordResetForm
what am I supposed to do to make the link works fine so that after click on the link it would successfully direct to the django url to change the passwor.
(I am thinking of override django's induilt PasswordResetForm in https://github.com/django/django/blob/master/django/contrib/auth/forms.py but the only thing I think I need to change is the 'domain_override=None' but then I would still have to keep the whole save function code. but this definitely is not the best way)
thank you for helping suggesting other ways to solve this problem.
The default domain in the sites
framework is called example.com
. You'd have to change that.