django-gcloud-storage
django-gcloud-storage copied to clipboard
Use credentials from a string
For some reason django-gcloud-storage needs Google SA credentials specifically stored in a file, which contracts the modern 12 factor approach where the apps/containers are stateless and everything is passed via environment variables.
Will you please add support for GCS_CREDENTIALS
(as opposed to GCS_CREDENTIALS_FILE_PATH
)? gcloud itself already supports it with storage.Client(credentials=google.auth.jwt.Credentials.from_service_account_info(json.load(base64.b64decode(settings.GCS_CREDENTIALS).decode("utf-8"))))
(vs. storage.Client.from_service_account_json
)
This would probably be a simple change mostly here. Feel free to open a PR with this. Alternatively this may already be possible with django-storages, since it supports gcloud natively for a while now.
Thank you, django-storages worked for me.