Advertisement
AllenYuan

save.py initial

May 1st, 2020
839
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. #!usr/bin/python
  2.  
  3. import firebase_admin
  4. from firebase_admin import credentials
  5. from firebase_admin import firestore
  6. import sys
  7. cred = credentials.Certificate("creds.json")
  8. firebase_admin.initialize_app(cred)
  9.  
  10. db = firestore.client()
  11.  
  12. data = {
  13.     u'name': u'Los Angeles',
  14.     u'state': u'CA',
  15.     u'country': u'USA'
  16. }
  17.  
  18. db.collection(u'app').document(u'grid').set(data)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement