I've set up a cookiecutter-django
project for testing and it worked just fine printing the confirmation email to the console. However, it's important to me to also test the actual sending of the emails and when I tried to adjust the settings for a local testing environment, it gave me a SMTP AUTH extension not supported by server.
error after adding a new account.
I changed EMAIL_BACKEND
to EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
and added the relevant EMAIL_HOST
, EMAIL_PORT
, EMAIL_HOST_USER
, and EMAIL_HOST_PASSWORD
settings in the local.py
settings file.
I'm using a yahoo account that was set up for this purpose and worked just fine outside of Django.
I can't find anything in the cookie-cutter
documentation about how to configure this and the Django documentation has been less than helpful.
Edit to add:
email settings:
EMAIL_PORT = 587
EMAIL_HOST = 'smtp.mail.yahoo.com'
EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.smtp.EmailBackend')
Full traceback:
Internal Server Error: /accounts/signup/
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 53, in inner
return func(*args, **kwds)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
return view(request, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/utils/decorators.py", line 63, in bound_func
return func.__get__(self, type(self))(*args2, **kwargs2)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/allauth/account/views.py", line 210, in dispatch
return super(SignupView, self).dispatch(request, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/allauth/account/views.py", line 79, in dispatch
**kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/allauth/account/views.py", line 188, in dispatch
**kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/allauth/account/views.py", line 102, in post
response = self.form_valid(form)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/allauth/account/views.py", line 231, in form_valid
self.get_success_url())
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/allauth/account/utils.py", line 188, in complete_signup
signal_kwargs=signal_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/allauth/account/utils.py", line 151, in perform_login
send_email_confirmation(request, user, signup=signup)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/allauth/account/utils.py", line 319, in send_email_confirmation
signup=signup)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/allauth/account/models.py", line 60, in send_confirmation
confirmation.send(request, signup=signup)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/allauth/account/models.py", line 166, in send
get_adapter(request).send_confirmation_mail(request, self, signup)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/allauth/account/adapter.py", line 447, in send_confirmation_mail
ctx)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/allauth/account/adapter.py", line 140, in send_mail
msg.send()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/mail/message.py", line 348, in send
return self.get_connection(fail_silently).send_messages([self])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/mail/backends/smtp.py", line 104, in send_messages
new_conn_created = self.open()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/mail/backends/smtp.py", line 71, in open
self.connection.login(force_str(self.username), force_str(self.password))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/smtplib.py", line 696, in login
"SMTP AUTH extension not supported by server.")
smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.