使用Google BigQuery作为Django的后端 [英] Using Google BigQuery as a backend for Django
问题描述
我正在考虑将Google BigQuery用作Django的后端,但不能确定是否可行,如果可以,将应用哪些设置.
I am considering using Google BigQuery as a back-end for Django but cannot be certain if this is possible, and if it is, what settings would apply.
当前,我的Django应用程序使用Postgresql,settings.py中的代码如下:
Currently, my Django application uses Postgresql, and the code in settings.py is as follows:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'mydatabase',
'USER': 'mydatabaseuser',
'PASSWORD': 'mypassword',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}
理想情况下,我想通过settings.py设置与Google BigQuery的数据库连接,然后照常使用视图和模型.
Ideally, I'd like to setup a database connection to Google BigQuery through settings.py and then use views and models as usual.
推荐答案
这是不可能的,或者至少不受支持.您可以直接使用API,但是显然您将无法获得ORM的任何优势.
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.
这篇关于使用Google BigQuery作为Django的后端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!