Skip to content

Instantly share code, notes, and snippets.

@azrafe7
Created April 25, 2020 21:42
Show Gist options
  • Save azrafe7/686a0adf4a4e38b6e7e4158b701d7a86 to your computer and use it in GitHub Desktop.
Save azrafe7/686a0adf4a4e38b6e7e4158b701d7a86 to your computer and use it in GitHub Desktop.
NOTES: heroku + pydrive + GDrive auth + upload to folder
  • setup heroku project
  • setup GDrive auth via cloud console (watch out for slashes when setting up URIs)
  • download client_secrets.json and put it in the local root folder (so PyDrive can use it)
  • gitignore it
  • use CommandLineAuth() instead of LocalWebserverAuth() locally
  • put the relevant secrets in local json files to be used for auth locally
  • test it locally and ensure it all works
  • create secret env keys in heroku with the content of both received jsons
  • be sure to gitignore both json files
  • create a ".profile" that will create the two files from ENV secrets when the docker image is run on heroku
    • something like
    echo ${CLIENT_SECRETS} > client_secrets.json
    echo ${MY_CREDENTIALS} > my_credentials.json
    
  • deploy to heroku
  • retest

NOTE2SELF: to access the remote heroku server for the app you can heroku run bash and go from there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment