DEV Community

Discussion on: Flask Rest API -Part:5- Password Reset

Collapse
 
joehoeller profile image
joehoeller • Edited

The code in your github doesnt work when ran. Just returns server 500s after request is made in Postman.

Collapse
 
paurakhsharma profile image
Paurakh Sharma Humagain

I just tried running the code from GitHub and everything went well. Can you please provide me more details like, in which endpoint you got 500. And also the error message in the terminal.

Also, did you remember to run python smtp server with python -m smtpd -n -c DebuggingServer localhost:1025
?

Collapse
 
pat64j profile image
Patrick Adonteng

I run the smtp server but I still get the "ConnectionRefusedError"

I want to ask: do I have to run it in my virtual environment? or in my normal mac terminal?

Thread Thread
 
paurakhsharma profile image
Paurakh Sharma Humagain

It doesn't have to be in your virtual environment. Just remember not to close the terminal running it.

Collapse
 
yosefco3 profile image
Yosef Cohen • Edited

I had the same problem.
My mistake was that I defined the email settings in .env file, and i forgot to import that settings to my app file.
And I still got that error, until I declared my :
mail = Mail(app)
after all that imported settings.