pennersr/django-allauth — pull request #432 by pmav99 (2013-10-23 21:17:09+00:00)
Title:  Fix bug on the example, when signing up with email

On the example, when you sign up a new user without using an email, everything
works fine. However, if you do define an email address an exception is raised.

The reason why this happens, is that no email server has been setup. The
proposed fix is to use Django's console email backend. There are other solutions
but this one seems to be the simplest. A tested alternative has also been added
in the documentation.

In order to avoid any pitfalls a warning has been added to remove the console
email backend and setup a proper email server.

``` python

Environment:

Request Method: POST
Request URL: http://127.0.0.1:8000/accounts/signup/

Django Version: 1.5.4
Python Version: 2.7.5
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.dropbox',
'allauth.socialaccount.providers.facebook',
'allauth.socialaccount.providers.google',
'allauth.socialaccount.providers.github',
'allauth.socialaccount.providers.linkedin',
'allauth.socialaccount.providers.openid',
'allauth.socialaccount.providers.persona',
'allauth.socialaccount.providers.soundcloud',
'allauth.socialaccount.providers.stackexchange',
'allauth.socialaccount.providers.twitch',
'allauth.socialaccount.providers.twitter',
'allauth.socialaccount.providers.vimeo',
'allauth.socialaccount.providers.weibo',
'example.demo')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')

Traceback:
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
115. response = callback(request, *callback_args, **callback_kwargs)
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/django/views/generic/base.py" in view
68. return self.dispatch(request, *args, **kwargs)
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/allauth/account/views.py" in dispatch
43. **kwargs)
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/allauth/account/views.py" in dispatch
99. **kwargs)
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch
86. return handler(request, *args, **kwargs)
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/django/views/generic/edit.py" in post
165. return self.form_valid(form)
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/allauth/account/views.py" in form_valid
130. self.get_success_url())
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/allauth/account/utils.py" in complete_signup
149. signal_kwargs=signal_kwargs)
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/allauth/account/utils.py" in perform_login
113. send_email_confirmation(request, user, signup=signup)
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/allauth/account/utils.py" in send_email_confirmation
276. signup=signup)
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/allauth/account/models.py" in send_confirmation
54. confirmation.send(request, signup=signup)
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/allauth/account/models.py" in send
125. ctx)
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/allauth/account/adapter.py" in send_mail
87. msg.send()
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/django/core/mail/message.py" in send
255. return self.get_connection(fail_silently).send_messages([self])
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/django/core/mail/backends/smtp.py" in send_messages
88. new_conn_created = self.open()
File "/home/faramir/.virtualenvs/bug/lib/python2.7/site-packages/django/core/mail/backends/smtp.py" in open
49. local_hostname=DNS_NAME.get_fqdn())
File "/usr/lib64/python2.7/smtplib.py" in __init__
250. (code, msg) = self.connect(host, port)
File "/usr/lib64/python2.7/smtplib.py" in connect
310. self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib64/python2.7/smtplib.py" in _get_socket
285. return socket.create_connection((host, port), timeout)
File "/usr/lib64/python2.7/socket.py" in create_connection
571. raise err

Exception Type: error at /accounts/signup/
Exception Value: [Errno 97] Address family not supported by protocol

```