我用django-registration为我的项目管理用户注册,登录,等等。但是当我申请帐户了,我碰到这个问题来了:Django的注册SMTPServerDisconnected错误
SMTPServerDisconnected
为了记录在案,我在我的settings.py中配置了电子邮件相关的设置:
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 465
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'mypassword'
另外我也有所有需要和可访问的模板。所以这个问题与此无关。
更多错误描述:
我点击发送激活邮件后,需要很长的时间才终于给这个错误。
这里是回溯(未完成):
SMTPServerDisconnected at /accounts/register/
Connection unexpectedly closed
last trace back:
/usr/lib/python2.7/smtplib.py in getreply
line = self.file.readline()
except socket.error as e:
self.close()
raise SMTPServerDisconnected("Connection unexpectedly closed: "
+ str(e))
if line == '':
self.close()
raise SMTPServerDisconnected("Connection unexpectedly closed")
...
if self.debuglevel > 0:
print>>stderr, 'reply:', repr(line)
resp.append(line[4:].strip())
code = line[:3]
# Check that the error code is syntactically correct.
# Don't attempt to read a continuation line if it is broken.
感谢您的任何建议。
一半写我的答案,我看到了一个新的答案幻灯片。是的,这是这个问题,我会选择你的答案:) – Gnijuohz