Created
March 30, 2020 16:06
-
-
Save ochilab/ad69767831f73b1d7d8f77fbca8aef48 to your computer and use it in GitHub Desktop.
PythonでFirebaseを用いる際のサービスアカウント情報の設定
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import firebase_admin | |
from firebase_admin import credentials | |
from firebase_admin import firestore | |
import os | |
#環境変数 | |
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = './xxxxx-credentials.json' | |
#credentialsの読み込み | |
cred = credentials.Certificate('xxxxx-credentials.json') | |
firebase_admin.initialize_app(cred) | |
db = firestore.Client() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment