Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django-oscar registration error: Socket error 10061 - Connection refused

I am following the instruction here: http://django-oscar.readthedocs.org/en/latest/internals/getting_started.html

When i was trying to register @ http://127.0.0.1:8000/accounts/login/, i got this error:

Environment:

Django Version: 1.8.3 Python Version: 2.7.9

Traceback:
File "/home/yw/oscar/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/yw/oscar/local/lib/python2.7/site-packages/django/views/generic/base.py" in view
  71.             return self.dispatch(request, *args, **kwargs)
File "/home/yw/oscar/local/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch
  89.         return handler(request, *args, **kwargs)
File "/home/yw/oscar/local/lib/python2.7/site-packages/oscar/apps/customer/views.py" in post
  124.             return self.validate_registration_form()
File "/home/yw/oscar/local/lib/python2.7/site-packages/oscar/apps/customer/views.py" in validate_registration_form
  210.             self.register_user(form)
File "/home/yw/oscar/local/lib/python2.7/site-packages/oscar/apps/customer/mixins.py" in register_user
  55.             self.send_registration_email(user)
File "/home/yw/oscar/local/lib/python2.7/site-packages/oscar/apps/customer/mixins.py" in send_registration_email
  92.             Dispatcher().dispatch_user_messages(user, messages)
File "/home/yw/oscar/local/lib/python2.7/site-packages/oscar/apps/customer/utils.py" in dispatch_user_messages
  56.             self.send_user_email_messages(user, messages)
File "/home/yw/oscar/local/lib/python2.7/site-packages/oscar/apps/customer/utils.py" in send_user_email_messages
  72.         email = self.send_email_messages(user.email, messages)
File "/home/yw/oscar/local/lib/python2.7/site-packages/oscar/apps/customer/utils.py" in send_email_messages
  103.         email.send()
File "/home/yw/oscar/local/lib/python2.7/site-packages/django/core/mail/message.py" in send
  303.         return self.get_connection(fail_silently).send_messages([self])
File "/home/yw/oscar/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py" in send_messages
  100.             new_conn_created = self.open()
File "/home/yw/oscar/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py" in open
  58.             self.connection = connection_class(self.host, self.port, **connection_params)
File "/usr/lib/python2.7/smtplib.py" in __init__
  256.             (code, msg) = self.connect(host, port)
File "/usr/lib/python2.7/smtplib.py" in connect
  316.         self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib/python2.7/smtplib.py" in _get_socket
  291.         return socket.create_connection((host, port), timeout)
File "/usr/lib/python2.7/socket.py" in create_connection
  575.         raise err

Exception Type: error at /accounts/login/
Exception Value: [Errno 111] Connection refused
like image 839
sunshine Avatar asked Dec 19 '22 01:12

sunshine


1 Answers

This is because the Email Backend has not been set up yet. Add

 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

to settings.py.

Hope it helps fix the problem.

like image 125
warun26 Avatar answered Dec 31 '22 23:12

warun26