I'm making a web app where you can both upload and download files but I'm hosting it on Heroku so I couldn't store the files on my computer. I decided to use something called Flask-GoogleStorage but it required a "Google Cloud Storage Client." I went to the cloud console and made a service account and put the private key in my code but I keep on getting this error:
[2022-01-03 19:54:20,784] WARNING in google_storage: Could not authenticate the Google Cloud Storage client
Here is my code I'm using to setup the storage:
app.config['GOOGLE_APPLICATION_CREDENTIALS'] = PRIVATE_SERVICE_KEY
app.config['GOOGLE_STORAGE_LOCAL_DEST'] = UPLOAD_FOLDER
app.config['SERVER_NAME'] = SERVER_NAME
#Google cloud storage
with app.app_context():
files = Bucket("files")
storage = GoogleStorage(files)
app.config.update(
GOOGLE_STORAGE_LOCAL_DEST = app.instance_path,
GOOGLE_STORAGE_SIGNATURE = {"expiration": timedelta(minutes=5)},
GOOGLE_STORAGE_FILES_BUCKET = "files-bucket-id"
)
storage.init_app(app)
Any advice would be super helpful as I haven't used this google platform before and I'm quite lost.
If there's any easier way to store files online, I would also greatly appreciate knowing about that.
Thank you in advance!