Thursday, 27 September 2018

python django email set correct sender gunicorn

This is my settings.py:

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com' # mail service smtp
EMAIL_HOST_USER = 'xx@xx.com' # email id
EMAIL_HOST_PASSWORD = 'sdjlfkjdskjfdsjkjfkds' #password
EMAIL_PORT = 587
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = 'xx@xx.com'

I am sending password reset email It works fine on localhost but on production server as sender I get webmaster@localhost

What do I do?

This is my urls.py

 url(r'^password_reset/$', auth_views.PasswordResetView.as_view(
        template_name='accounts/password_reset.html',
        email_template_name = 'accounts/email/password_reset.html',
        html_email_template_name = 'accounts/email/password_reset.html',
        subject_template_name = 'accounts/email/password_reset_subject.html'),



from python django email set correct sender gunicorn

No comments:

Post a Comment