0

I'm trying to use PyDrive on Heroku. My code is as follows.

from pydrive.auth import GoogleAuth
GoogleAuth.DEFAULT_SETTINGS['client_config_file'] = os.path.join(os.path.dirname(__file__), 'client_secrets.json')

However, the heroku console returned "No such file or directory: '/app/client_secrets.json'". Through heroku run bash command, I confirmed that '/app/client_secrets.json' surely existed.

How do I fix this?

Daisuke SHIBATO
  • 983
  • 2
  • 11
  • 23

1 Answers1

0

You should do this first

gauth = GoogleAuth()

then

GoogleAuth.DEFAULT_SETTINGS['client_config_file'] = os.path.join(os.path.dirname(__file__), 'client_secrets.json')
gauth.LoadCredentials()

Hope this is helpful to you.

Lun Lee
  • 1
  • 1