Skip to main content

Posts

Showing posts from March, 2021

Firebase Realtime Database / Cloud Firestore Connection Python Django

It is always interesting to combine firebase with another server such as elasticsearch or crawler or mailing server on a separate server. Then of course a connection is needed, we use python in this example. sudo pip install firebase-admin import firebase_admin from firebase_admin import credentials cred = credentials . Certificate ( "path/to/serviceAccountKey.json" ) firebase_admin . initialize_app ( cred ) https://firebase.google.com/docs/admin/setup#python   Init and Retrieve Data from  https://firebase.google.com/docs/database/admin/start   https://firebase.google.com/docs/database/admin/retrieve-data def handle(self, *args, **options):          cred = credentials.Certificate("/")          firebase_admin.initialize_app(cred, {                  'databaseURL': 'https://database.firebaseio.com'          })          jobs = Job.objects.all()[:3]          ref = db.reference("/jobs")          import pdb;pdb.set_trace()          for job in

Postgres into a distributed database Citus Django Ubuntu

Citus is an open source extension of Postgres that can distribute data and queries among multiple nodes in a cluster. Because Citus is an extension (not a branch) of Postgres, when you use Citus, you are also using Postgres. You can take advantage of the latest Postgres features, tools, and ecosystem. In apt-get I could not add repositories because it is configured by default only have support for only LTS versions of operating systems. I will try manually downloading and installing the package. https://repos.citusdata.com/community/    This repository is all moved…  I found packages on this repository.  https://packagecloud.io/citusdata/community   wget --content-disposition https://packagecloud.io/citusdata/community/packages/ubuntu/focal/postgresql-12-citus-10.0_10.0.2.citus-1_amd64.deb/download.deb   sudo dpkg -i postgresql-12-citus-10.0_10.0.2.citus-1_amd64.deb Package libpq5 is not installed. postgresql-12-citus-10.0 depends on postgresql-12; however Package postgresql-12 is not