How Do I Enable Less Secure Apps On Gmail

When I develop a 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.

  1. Go to web page to login to your google account.
  2. Click the Security menu item on left, then scroll down on right and click the Turn on access(not recommended) link under the Less secure app access section in right.
  3. Now turn on Allow less secure apps:ON toggle button on the new page.
  4. 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.
  5. But as google said this action is not recommended, because there will be risks for your Gmail account. So you had better turn it off after your testing to make your google account more safety.

2. How To Fix Can Not Find The Allow Less Secure Apps Option.

  1. If you can not find the Less secure app access section on the Security page right side, this is because your Gmail account has enabled the 2-step verification.
  2. To fix this error, you can either disable the 2-step verification or you can create an app special password for your application, then your less secure apps can access the Gmail account.
  3. First login to your Google account, then click the Security link on the page left side.
  4. Then on the page right side Signing in to Googlesection, click the App passwords arrow.
  5. It will open the App passwords page. Select Mail in the Select app drop-down list. Select the device from the Select device drop-down list.
  6. You can also select Other (Custom name) from the drop-down list to create your own app password.
  7. Click the Generate button to create the app password.
  8. Now it will popup a Generated app password dialog to let you see the app password and how to use it in your device and application.
3 1 vote
Article Rating
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Oldest Most Voted
Inline Feedbacks
View all comments

I write a mail sender to use Gmail account to send test emails for testing. But when I run the application, it shows the error message

Invalid login: Username and Password not accepted. Learn more at

I follow this article steps, but I can not find the link that can turn “Less secure apps” on in my Gmail account settings. Can anybody tell me how to fix it? Thanks.


I write a Django application and send emails through the Gmail SMTP server ( in this Django application. When I run my Django app, it popups this error, and I follow this article to fix the error. My question is why google treat my Django app as less secure app? How can I make google to think my Django app as secure app?

Ram manohar
Ram manohar

Hi Susan,

I have tried doing the same thing that he explained above but I am not able to find less secure apps option over there. kindly help me in solving this.

Mrs Anthea Gilkinson
Mrs Anthea Gilkinson
Reply to  Ram manohar

you might need to turn off 2 step verification temporarily.


I really thank you .My problem solved

Would love your thoughts, please comment.x