Reputation: 5
django-allauth
for my project.0.24.1
settings.py:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount',
]
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
SERVER_EMAIL = '[email protected]'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_SUBJECT_PREFIX = 'fuyun'
DEFAULT_FROM_EMAIL = '[email protected]'
And other settings are default. but when i sign up or sign in and resend confirmation, it just prints the email confirmation message on the terminal.i don't know why,i hope someone can help me, thanks!
Upvotes: 0
Views: 1072
Reputation: 5800
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
<-- You see this line? I use this line when I am developing my project and I don't have an working email server running to send email. This prints the email message on the console so that the developer knows if he does setup an email server and then connect it to the django project that email in the console will actually be sent!
As for the following code:
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
SERVER_EMAIL = '[email protected]'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_SUBJECT_PREFIX = 'fuyun'
DEFAULT_FROM_EMAIL = '[email protected]'
It looks like you are trying to connect your project to an email server you have setup already. In that case I cannot help you as I am yet to reach that point of my project. If you want this to work then remove the first line with ...console.EmailBackend
and then proceed. Good luck!
Upvotes: 2