Google 云数据存储 API Python 代码
Google Cloud Datastore API in Python Code
我正在尝试在我的 Python Django 项目中实施 Google Cloud DataStore,而不是 运行 在 Google App Engine 上实施。
是否可以在 Google App Engine 上没有项目 运行 的情况下使用 Google 数据存储?如果是,能否请您告知如何检索完整的实体对象或成功执行查询?
下面的代码片段打印了查询对象,但之后抛出错误。
代码片段:
from gcloud import datastore
entity_kind = 'EntityKind'
numeric_id = 1234
client = datastore.Client()
key = client.key(entity_kind, numeric_id)
query = client.query(kind=entity_kind)
print(query)
results = list(query.fetch())
print(results)
错误:
NotFound: 404 The project gproj does not exist or it does not contain an active App Engine application. Please visit http://console.developers.google.com to create a project or https://console.developers.google.com/appengine?project=gproj to add an App Engine application. Note that the app must not be disabled.
我正在尝试在我的 Python Django 项目中实施 Google Cloud DataStore,而不是 运行 在 Google App Engine 上实施。
是否可以在 Google App Engine 上没有项目 运行 的情况下使用 Google 数据存储?如果是,能否请您告知如何检索完整的实体对象或成功执行查询?
下面的代码片段打印了查询对象,但之后抛出错误。
代码片段:
from gcloud import datastore
entity_kind = 'EntityKind'
numeric_id = 1234
client = datastore.Client()
key = client.key(entity_kind, numeric_id)
query = client.query(kind=entity_kind)
print(query)
results = list(query.fetch())
print(results)
错误:
NotFound: 404 The project gproj does not exist or it does not contain an active App Engine application. Please visit http://console.developers.google.com to create a project or https://console.developers.google.com/appengine?project=gproj to add an App Engine application. Note that the app must not be disabled.