小编dol*_*hin的帖子

使用 python 在 Firestore 中的 GeoPoint

我正在尝试使用 Python 在我的 Firebase Firestore 中保存 GeoPoint,但我没有成功。这给了我语法错误:

location=new firebase.firestore.GeoPoint(latitude, longitude)
Run Code Online (Sandbox Code Playgroud)

有什么解决办法吗?也许我缺少要导入的东西,但我找不到什么。提前致谢。

python python-3.x firebase google-cloud-firestore

8
推荐指数
1
解决办法
2023
查看次数

查找上传文件的网址,firebase存储+ python

我想知道如何从上传到Firebase存储的文件中获取url?这是我的代码:

    import firebase_admin
from firebase_admin import credentials, firestore, storage

cred=credentials.Certificate('/serviceAccountKey.json')
firebase_admin.initialize_app(cred, {
    'storageBucket': <my_bucket_name>
})
db = firestore.client()

bucket = storage.bucket()
blob = bucket.blob('image.jpg')
blob.upload_from_filename('/image.jpg')

#here I'd like to have url of file I uploaded
print(blob.<url>)
Run Code Online (Sandbox Code Playgroud)

提前致谢。

python-3.x firebase firebase-admin

5
推荐指数
2
解决办法
1540
查看次数