我已经完成了 django 注册设置并使用我的应用程序。我使用的是 django 1.1,并使用最新的 django-registration,0.8 alpha。
如果相关,我使用 fcgi 方法进行部署,并将 django-registration 应用程序部署在单独的文件夹中。我只是将包含的文件夹添加到 python 路径中。即在我的应用程序的settings.py中,我
import sys
sys.path.append('/path/to/django-registration-parent-folder')
在我的设置文件中也设置了
DEFAULT_FROM_USER = '[email protected] used'
当django注册发送激活电子邮件时,但是,它仍然来自
网站管理员@localhost
我能够更改此设置的唯一方法是更改 django-registration 内部的实际代码。即在 models.py 第 254 行:
# self.user.email_user(subject, message, settings.DEFAULT_FROM_EMAIL)
self.user.email_user(subject, message, '[email protected] used')
任何人都可以告诉我为什么在发送激活电子邮件时不使用我的应用程序设置文件中的 DEFAULT_FROM_EMAIL 吗?
提前致谢
i've got django-registration setup and working with my application. I'm on django 1.1 and using the latest django-registration, 0.8 alpha.
in case it is relevant, i'm using the fcgi method to deploy and the django-registration app is deployed in a separate folder. I simply add the containing folder to python path. i.e. in settings.py of my app i do
import sys
sys.path.append('/path/to/django-registration-parent-folder')
in my settings file i have also set
DEFAULT_FROM_USER = '[email protected] used'
When django registration sends out the activation email, however, it continues to be from
webmaster@localhost
the only way i was able to change this was by changing the actual code inside of django-registration. i.e. in models.py line 254:
# self.user.email_user(subject, message, settings.DEFAULT_FROM_EMAIL)
self.user.email_user(subject, message, '[email protected] used')
Can anybody enlighten me as to why DEFAULT_FROM_EMAIL in the settings file of my app is not being used when sending activation emails?
thanks in advance
发布评论
评论(2)
拼写错误,您在设置中设置了
DEFAULT_FROM_USER
,但它应该是DEFAULT_FROM_EMAIL
。A typo, you set
DEFAULT_FROM_USER
in your settings, but it should beDEFAULT_FROM_EMAIL
.settings.py 中的代码段是
DEFAULT_FROM_USER
而不是DEFAULT_FROM_EMAIL
The snippet from settings.py is
DEFAULT_FROM_USER
instead ofDEFAULT_FROM_EMAIL