When i develop Python application, sometimes i need to access my gmail account from the Python source code. But this is not allowed by google by default, you need to configure some settings to make it happen. This article will tell you how to make your gmail account accessed by less secure apps such as from Python source code.
1. Turn On Allow Less Secure Apps Access Google Account Steps.
- Goto https://accounts.google.com/ web page to login to google account.
- Click Security menu item in left, then scroll down in right and click Turn on access link under Less secure app access section in right.
- Now turn on Allow less secure apps:ON toggle button in the new page.
- Now click the back arrow in the title, you can find the Allow less secure apps has been turned on. You can access your gmail account in your Python code now.
- But as google said this action is not recommended, because there will be risks for you gmail account. So you had better turn it off after your testing to make your google account more safety.