How to use 2 different projects of Firebase Realtime Database inside the same Python script?

Viewed 22

As shown in the official tutorial, a Firebase Realtime Database is initialized like:

    cred_object = firebase_admin.credentials.Certificate("key.json")
default_app = firebase_admin.initialize_app(cred_object, {
    'databaseURL':"database_url"
    })

after doing this, the firebase_admin.db method returns the initialized database.

Now I need to have 2 different projects with 2 different urls inside the same python script but couldn't understand nor found anyway to achieve this. As an example, I would like to call the second database with firebase_admin.db2.

I would like to know if anyone did this before or knows how to do it. Thanks in advance.

0 Answers
Related