을 나는이 문서 여기 https://firebase.google.com/docs/storage/gcp-integration#apis중포 기지 업로드 이미지는 중포 기지 저장하기
라인 client = storage.Client()
에서
# Import gcloud
from google.cloud import storage
# Enable Storage
client = storage.Client()
# Reference an existing bucket.
bucket = client.get_bucket('my-existing-bucket')
# Upload a local file to a new file to be created in your bucket.
zebraBlob = bucket.get_blob('zebra.jpg')
zebraBlob.upload_from_filename(filename='/photos/zoo/zebra.jpg')
# Download a file from your bucket.
giraffeBlob = bucket.get_blob('giraffe.jpg')
giraffeBlob.download_as_string()
가 말했다이 문서에서 코드를 찾을 이니
자격 증명을 자동으로 결정할 수 없습니다. GOOGLE_APPLICATION_CREDENTIALS를 설정하거나 명시 적으로 자격 증명을 만들고 내가
을 넣어하고 다음 단계에서 응용 프로그램from oauth2client.client import GoogleCredentials GOOGLE_APPLICATION_CREDENTIALS = 'credentials.json' credentials = GoogleCredentials.get_application_default()
을 다시 실행하십시오 말했다 :
응용 프로그램의 기본 자격 증명을 사용할 수 없습니다. Google Compute Engine에서 실행중인 경우 사용할 수 있습니다.
마지막으로 Google Compute Engine에서 인증하는 방법에 대해 알아 봅니다.