2

I am following a blog to reset the password in django. It states to add :

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'  # During development only

in settings.py file.

But I want to deploy my web application in production. So what steps should I take care about? Will this tutorial is safe for the production too?

The blog link is given below:

https://simpleisbetterthancomplex.com/tutorial/2016/09/19/how-to-create-password-reset-view.html

2 Answers 2

1

You should follow the django documentation and the checklist for production deploy to be on the safer side. And as far as the tutorial goes, it is a very well explained blog for learning about django.

Django Production Deployment checklist

Sign up to request clarification or add additional context in comments.

Comments

0

As it is mentioned in tutorial it is only for Development. But when you move to prodution you need to configure it properly based on your SMTP type. I'll specify it all here:

For production (DEBUG=False)

SMTP Email-    EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend'
Server    -    EMAIL_HOST=127.0.0.1
(Standard)-    EMAIL_PORT=25
               EMAIL_HOST_USER=<smtp_user>
               EMAIL_HOST_PASSWORD=<smtp_user_pwd>
  • If the SMTP email server is running on a network or a different port than the default, adjust EMAIL_HOST and EMAIL_PORT accordingly.

  • In today's email spam infested Internet, nearly all SMTP email servers require authentication to send email. If your SMTP server doesn't require authentication you can omit EMAIL_HOST_USER and EMAIL_HOST_PASSWORD.


Django email configuration for Gmail or Google Apps account

This is all you need to set up a default email connection to Gmail or Google Apps in Django. In your settings.py use this code with your credentials:

EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST='smtp.gmail.com'
EMAIL_PORT=587
EMAIL_HOST_USER='[email protected]/OR/[email protected]'
EMAIL_HOST_PASSWORD='password'
EMAIL_USE_TLS=True

6 Comments

Sir @ans2human should I add EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' in my development phase and when I move to production, I will add email backend host port according to your instruction in settings.py file. is it fine?
yes brother, for the developement part you play around with the settings given by Vitor, when moving to production use these configurations.
@imsaiful, but you can still try these settings just to check they work and then you may support this answers for accepting it, which will work as a reference point for people having same query.
Ok Sir @ans2human thank you so much. I am developing an application for my society. I will need your help again when I will deploy this on AWS ec2
for Aws the settings differ, so drop a comment when you need those settings, i will update the answer.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.