新手到Django在這裏,目前試圖執行密碼恢復使用管理員password_reset函數,但我得到一個錯誤。從我讀過的有關類似問題的其他人那裏瞭解到某種端口/套接字問題,但我不太清楚如何改變或修復它。我應該提到,我通過一個虛擬的ubuntu來運行它,不確定這與它有什麼關係。Errno 111連接拒絕了一個非常基本的密碼重置
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/admin/password_reset/
Django Version: 1.1.4
Python Version: 2.6.6
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'homework.events',
'django.contrib.admin']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware')
Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response
99. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/views.py" in password_reset
116. form.save(**opts)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/forms.py" in save
136. t.render(Context(c)), None, [user.email])
File "/usr/local/lib/python2.6/dist-packages/django/core/mail.py" in send_mail
407. connection=connection).send()
File "/usr/local/lib/python2.6/dist-packages/django/core/mail.py" in send
281. return self.get_connection(fail_silently).send_messages([self])
File "/usr/local/lib/python2.6/dist-packages/django/core/mail.py" in send_messages
179. new_conn_created = self.open()
File "/usr/local/lib/python2.6/dist-packages/django/core/mail.py" in open
144. local_hostname=DNS_NAME.get_fqdn())
File "/usr/lib/python2.6/smtplib.py" in __init__
239. (code, msg) = self.connect(host, port)
File "/usr/lib/python2.6/smtplib.py" in connect
295. self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib/python2.6/smtplib.py" in _get_socket
273. return socket.create_connection((port, host), timeout)
File "/usr/lib/python2.6/socket.py" in create_connection
561. raise error, msg
Exception Type: error at /admin/password_reset/
Exception Value: [Errno 111] Connection refused
我知道我必須(可能)改變一些端口,只是不知道如何去修復錯誤。另外,我對代碼編輯不佳表示歉意。提前致謝。
相關問題:http://stackoverflow.com/questions/5802189/django-errno-111-connection-refused – hcs42 2011-09-07 16:19:07