From the course: Building RESTful APIs with Flask

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Setting up email

Setting up email

From the course: Building RESTful APIs with Flask

Start my 1-month free trial

Setting up email

- [Instructor] It is a foregone conclusion that at some point one of our intrepid yet forgetful scientists will forget their password. We need a way for them to retrieve it or to reset it. My theme so far has been to keep it simple and I won't be deviating from that. You can make this a fancy workflow that emails a reset link. I'm just going to show you how to send the email with the password in it and you can use the technique to construct whatever you'd like. We're going to need a plugin to help us with mail. There are several to choose from and I rather arbitrarily went with flask-mail just because that's the one I first learned with. You can find information on it at pythonhosted.org/flask-mail. Let's go back into PyCharm and let's install flask-mail. By now this is probably old hat, so go into Preferences, Project Interpreter, press the plus sign and let's type in flask-mail. I'll click Install package and then I'll go ahead and close this window and I'll click OK down here at…

Contents