Hello,
Once again, I have an issue that I'm stumped on. I'm trying to set up a password reset page in a blog using django. I added the following to the settings.py file:
EMAIL_HOST_USER = os.getenv('EMAIL_USER')
EMAIL_HOST_PASSWORD = os.getenv('EMAIL_PASSWORD')
and the following in the .env file located in the project directory:
export EMAIL_USER="fakeemail@gmail.com"
export EMAIL_PASSWORD="NotActualPassword"
If I were to use the bash console, load the webapp virtual environment and run the following code:
>>import os
>>EMAIL_HOST_USER = os.getenv('EMAIL_USER')
>>EMAIL_HOST_USER
I get, as a result:
>>fakeemail@gmail.com
So, despite all this seemingly working in theory, when I do try to reset the password it gives me an SMTPSenderRefused error.
I can have the password reset issue work without problems by not using environment variables in settings.py, as so:
EMAIL_HOST_USER = "fakeemail@gmail.com"
EMAIL_HOST_PASSWORD = "NotActualPassword"
However, I want the environment variable to work because I want to also use AWS and not have the user secret access key show up in the code.
P.S. I don't know if it helps, but I've set up the virtual environment to load in the postactivate script, and get the following:
echo $EMAIL_USER
fakeemail@gmail.com
Is there anything that I could be missing?