christiankyle-ching/roomfiles

Unable to deploy on Heroku

Opened this issue · 6 comments

I tried to deploy it on heroku but it's showing several errors. Is there anything that I have to change in the settings in order to deploy it on heroku . Kindly help.

Thanks in advance.

Are there any errors that might be helpful?

Are there any errors that might be helpful?

Screenshot from 2020-11-18 19-51-09
Screenshot from 2020-11-18 19-50-59

I'm getting this error. Kindly help if possible.
Thanks.

I forgot to mention a part in the README.md. Django-googledrive-storage works on local machine even with JSON filepath referenced because it can find it. Please don't check your JSON into the source control especially if it would be a public repository. The way to go is to put the contents of your JSON file in an Environment Variable (Config Vars in Heroku's terms).

Please try this:

  1. Copy the contents of your JSON file as text.
  2. Go to your Heroku project settings, and in Config Vars, create a new key-value pair with:
    Key/Name: GOOGLE_DRIVE_STORAGE_JSON_KEY_FILE_CONTENTS
    Value: paste the contents of JSON
  3. Try to run migrate again.

Please post an update if you're done.

Hi, I faced another problem while trying this .
I have copied the contents of the Json file to an environment variable with the name GOOGLE_DRIVE_STORAGE_JSON_KEY_FILE_CONTENTS as you recommended earlier in the README.md .But I'm getting this error. Kindly help me out solving this ,then I can continue trying the further steps .
Thanks.
Screenshot from 2020-11-18 23-10-14

Config Vars can take some time to take effect. But in the meantime, please hold on while I'll try and recreate this issue. Thanks.

Screenshot from 2020-11-24 17-02-20

I am getting this error while deploying in heroku. Can you please help me with this error.
Thanks_

It seems that you're trying to use the JSON method of setting up your Google Service Account authentication, which as far as I know, won't work with Heroku (ephemeral disk / non-persistent filesystem). The better option is to create a new config var within Heroku Dashboard:

Key: GOOGLE_DRIVE_STORAGE_JSON_KEY_FILE_CONTENTS
Value: Paste the contents of the JSON you got from Google Accounts

Then, change this setting and in your settings.py and set it to: GOOGLE_DRIVE_STORAGE_JSON_KEY_FILE = None. This will force it to look for an environment variable (Config Vars in Heroku's terms) in the system with the name / key of GOOGLE_DRIVE_STORAGE_JSON_KEY_FILE_CONTENTS.