Previously we had feature to use your gmail password directly to your project as a host password in settings.py.Last year google have updated its privacy terms and discontinued this feature.
Now we need to create a specific passwords to avail such feature,in short your host password would be of 16 chars.
I will tell you steps to generate an app password that you can use in django projet.
- Visit your Google Account security page.
In the 2-Step Verification box, click Settings (if there is no settings link, you may want to create a new one. you can skip step 3 & 4).
Click the tab for App-specific passwords.
Click Manage your application specific passwords.
Under the Application-specific passwords section, enter a descriptive name for the application you want to authorize, such as “”Django gmail”” then click Generate application-specific password button.
note down the password. for example: "krishnapass"![password][1]
After finishing pervious steps,update your settings.py of your django project....
_EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'your-username@gmail.com'
EMAIL_HOST_PASSWORD = 'Application spectific password(for eg:krishnapass)'
EMAIL_PORT = 587
EMAIL_USE_TLS = True_
``
Top comments (0)