[Solved]-Using Google BigQuery as a backend for Django


It’s not possible, or at least not supported. You could use the API directly, but obviously you won’t get any advantages of the ORM.


It is possible by using SQLAlchemy with Django.

SQLAlchemy can connect to bigquery with the pybigquery driver.

See the following about how to
Configuring Django to use SQLAlchemy.



Everything is possible for sure. To create an interface would not be such a big job. But, I would just keep one note:

Bigquery is not intended to be backend database, rather it is more like data warehouse as it is defined within business intelligence discipline. This means, google will make it very hard for you to perform fast multi-user operations. As far as I can recall, update statements for example have have some thresholds.

On another hand, if this is purely for example data input, or visualisation of data, then why not. But then again, I think Azure power apps is kind of a product for it.


You should have a db motor like postgres, mysql, whatever…
The point is, this db motor is necessary to have it, because the structure works in that way.

but of course, you can invoke google cloud from librarys in django and use it as

from google.oauth2 import service_account
from google.auth.transport.requests import AuthorizedSession
from google.cloud import datastore
from google.cloud import bigquery

in my case I used to connect
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'OAuth2Credential.json'

for generate your .json you should go to the documentation in:

Leave a comment