Within my project, I want to send an email with python/Django. In order to do this, I need to specify multiple settings, and one of them is the password for my email. I want to retreive this from an environment variable.
When I reference the environment variable in settings.py, I get a message implying the value is wrong and not my actual password. I ensured that the environment variable is set to my actual password within bash_profile, and when I hardcoded my password in the settings file, the email is sent successfully.
This implies the issue is occurring when trying to retrieve the password as an environment variable.
SETTINGS.py:
import os
# me trying to retrieve password
EMAIL_HOST_PASSWORD = os.environ.get('email_password')
Anybody know the issue? Thank you.