I am using django 1.10 and python 3.5. I am using pyrebase for firebase DB access and all works well. But when I use pyrebase in django views it results in the entire API request to become much slower.
I debugged the code and found out the pyrebase db initialise and auth is taking up most of the time, firebase db connection gets created on every API request which doesn't seem right.
Is there a way I can persist this firebase conn in django?
Update:
This is the code i have used:
firebase = pyrebase.initialize_app(settings.config)
auth = firebase.auth()
db = firebase.database()
db.child('blah/blah').push(data)
This code has increased my API request latency.
Thanks for taking time to help me.