Forums

Safe method for storing google app password for flask-mail

Hi there, Firstly, I am new to web development and I can sound total noob, sorry for that. I have this code which is used for sending email from my gmail to user's email. I am using this feature during registration to my website and email's content is alert for successful registration.

app.config['MAIL_SERVER']='smtp.gmail.com'
app.config['MAIL_PORT'] = 465
app.config['MAIL_USERNAME'] = #myemailaccount
app.config['MAIL_PASSWORD'] = #myapppassword
app.config['MAIL_USE_TLS'] = False
app.config['MAIL_USE_SSL'] = True

I don't know how can I store google password safely. Also, my website's source code exists in GitHub repository. So, any idea about not showing a bunch of passwords publicly in GitHub would be highly appreciated as well.

Take a look at https://help.pythonanywhere.com/pages/environment-variables-for-web-apps