After initialising firebase, I've been trying to run the following code
self.db.child("devices").update({"passwords": [], "can_open": "false", "state": self.state.value})
However, I keep getting the same error:
requests.exceptions.HTTPError: [Errno 404 Client Error: Not Found for url: https://<project id>.firebaseapp.com/devices.json]
I'm currently using the pyrebase4 library. What can I do to resolve this?
edit: heres the pyrebase initialization code:
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",
}
CodePudding user response:
I think you may have entered the database URL wrong:
If your database is in the US, its URL is of the format: https://<project id>.firebaseio.com
.
If your database is in one of the other regions, its URL is in the format: https://<project-id>-default-rtdb.<region>.firebasedatabase.app/
.