diff --git a/account/views.py b/account/views.py index ce7f8ee..f57dce7 100644 --- a/account/views.py +++ b/account/views.py @@ -330,8 +330,7 @@ class ApplyResetPasswordAPIView(APIView): email_template = email_template.replace("{{ username }}", user.username). \ replace("{{ website_name }}", settings.WEBSITE_INFO["website_name"]). \ - replace("{{ link }}", request.scheme + "://" - + request.META['HTTP_HOST'] + "/reset_password/t/" + + replace("{{ link }}", settings.WEBSITE_INFO["url"] + "/reset_password/t/" + user.reset_password_token) _send_email.delay(settings.WEBSITE_INFO["website_name"], diff --git a/oj/custom_settings.example.py b/oj/custom_settings.example.py index 4274a19..3e7082b 100644 --- a/oj/custom_settings.example.py +++ b/oj/custom_settings.example.py @@ -5,6 +5,7 @@ import os WEBSITE_INFO = {"website_name": u"example大学 OnlineJudge", "website_name_shortcut": u"example oj", "website_footer": u"example大学信息学院京ICP备xxxxx号-1", + # url结尾没有/ "url": u"https://your-domain-or-ip.com"}