我用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