GrigoriMarkov
GrigoriMarkov

Reputation: 97

Django, environment variables. Error: SMTPRecipientsRefused at /password_reset/

it's my first post here.

I'm learning Django, and i'm trying to send an email to reset my password. There is one problem..

When I send an email with my username and password assigned to these constants, everything works well:

EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'Abc123'

But when i try to use environment variables instead:

EMAIL_HOST_USER = os.environ.get('EMAIL_USER')
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_PASS')

i got an error

SMTPRecipientsRefused at /password_reset/

{'[email protected]': (501, b': sender address must contain a domain')}

Am I doing something wrong? Maybe I should use environment variables in different ways?

In advance, thanks for your help, guys!

Upvotes: 0

Views: 317

Answers (1)

Smartybrainy
Smartybrainy

Reputation: 101

Hi I once ran into the same problem you are experiencing, but the simple solution is to exit you code editor or open it again and all should now be fixed, the problem is caused by system delays or deadlock.

Upvotes: 1

Related Questions