初始化 firebase 后,我一直在嘗試運行以下代碼
self.db.child("devices").update({"passwords": [], "can_open": "false", "state": self.state.value})
但是,我不斷收到相同的錯誤:
requests.exceptions.HTTPError: [Errno 404 Client Error: Not Found for url: https://<project id>.firebaseapp.com/devices.json]
我目前正在使用 pyrebase4 庫。我能做些什么來解決這個問題?
編輯:繼承人pyrebase初始化代碼:
firebase = pyrebase.initialize_app(config)
self.db = firebase.database()
self.db.child("devices").child(uuid).stream(self.sync_data)
config = {
"apiKey": "api key",
"authDomain": "<project id>.firebaseapp.com",
"databaseURL": "https://<project id>.firebaseapp.com",
"storageBucket": "<project id>.appspot.com",
}
uj5u.com熱心網友回復:
我想你可能輸入了錯誤的資料庫 URL:
如果您的資料庫位于美國,則其 URL 的格式為:https://<project id>.firebaseio.com.
如果您的資料庫位于其他區域之一,則其 URL 的格式為:https://<project-id>-default-rtdb.<region>.firebasedatabase.app/.
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/363619.html
