django-registration在哪里设置域和协议变量?

时间:2013-10-29 15:29:45

标签: django django-registration

在我的django应用程序中我正在使用django-registration app。几个月前我正在测试注册,它工作正常。从那以后我没有在django-registration中编辑,但不知怎的,它不再起作用了。好的注册邮件不包含正确的链接:

Someone, hopefully you, signed up for a new account at domain.com using this email address. If it was you, and you'd like to activate and use your account, click the link below or copy and paste it into your web browser's address bar:

:///accounts/activate/3789be99f7426ab3e332d252900479b59a400d45/

If you didn't request this, you don't need to do anything; you won't receive any more email from us, and the account will expire automatically in seven days.

这是我的activation_email.txt

{% load humanize %}
Someone, hopefully you, signed up for a new account at domain.com using this email address. If it was you, and you'd like to activate and use your account, click the link below or copy and paste it into your web browser's address bar:

{{ protocol }}://{{ domain }}/accounts/activate/{{ activation_key }}/

If you didn't request this, you don't need to do anything; you won't receive any more email from us, and the account will expire automatically in {{ expiration_days|apnumber }} days.

因此不传递协议和域变量。我应该在哪里设置它们?

1 个答案:

答案 0 :(得分:2)

我认为django-registration从django-site表中获取有关域的信息 - 您应该检查该表中的域字段或通过管理页面进行编辑。

您可以在此处阅读有关网站框架的内容: https://docs.djangoproject.com/en/dev/ref/contrib/sites/