简体   繁体   English

Python Firebase 存储模拟器

[英]Python firebase storage emulator

Hi I was wondering how to connect to my firebase storage emulator, this is how I connect to Firestore.嗨,我想知道如何连接到我的 firebase 存储模拟器,这就是我连接到 Firestore 的方式。 How do I do it with storage我如何处理存储

Firestore Example: Firestore 示例:

if emulator:
    os.environ["FIRESTORE_EMULATOR_HOST"] = "0.0.0.0:8080"
    os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "myCredentials.json"

# Retrieve the application credentials
cred = credentials.ApplicationDefault()

options = {
    "storageBucket": "my-storage-bucket-name.appspot.com"
}

# Initialise the app
firebase_app = firebase_admin.initialize_app(cred, options)

What is the equivalent for firebase storage? firebase 存储的等价物是什么?

Looking at the emulation documentation, it seems that the Python Admin SDK does not currently support the Storage emulator but it is listed as 'future' indicating it is in development but does not have a current release date.查看仿真文档,Python Admin SDK 目前似乎不支持存储仿真器,但它被列为“未来”,表明它正在开发中,但没有当前的发布日期。

Source: https://firebase.google.com/docs/emulator-suite/install_and_configure#admin_sdk_availability来源: https : //firebase.google.com/docs/emulator-suite/install_and_configure#admin_sdk_availability

From reading the documentation on connecting to the storage emulator from the Admin SDKs , you can set the GCLOUD_PROJECT environment variable which gets picked up by the Admin SDKs.通过阅读有关从 Admin SDKs 连接到存储模拟器的文档,您可以设置GCLOUD_PROJECT环境变量,该变量由 Admin SDKs 获取。 At least, that applies to the Node.js, so let me know once you've tried with the Python Admin SDK.至少,这适用于 Node.js,所以一旦您尝试使用 Python Admin SDK,请告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM