I have verified that the following code works on my local PC:
from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive path_to_your_file = 'file' #1st authentification gauth = GoogleAuth() gauth.LocalWebserverAuth() # Creates local webserver and auto handles authentication. drive = GoogleDrive(gauth) file1 = drive.CreateFile() file1.SetContentFile(path_to_your_file) file1.Upload()
I have followed the Quickstart example from Pydrive that included creating a project, oauth-credentials and saving the client_secrets.json
With pythonanywhere, a browserprompt opens in the bash console:
Has anyone recently used Pythonanywhere and PyDrive/GDrive file upload successfully? My App is unverified.