2011-08-10 90 views
0

我已經訪問命令行傳統的數據存儲如下sqlite的數據存儲:訪問命令行

from google.appengine.api import apiproxy_stub_map 
from google.appengine.api.datastore_file_stub import DatastoreFileStub 

os.environ['APPLICATION_ID']="myapp" 
apiproxy_stub_map.apiproxy=apiproxy_stub_map.APIProxyStubMap() 
stubname, stub = 'datastore_v3', DatastoreFileStub(os.environ["APPLICATION_ID"], Datastore, "/") 
apiproxy_stub_map.apiproxy.RegisterStub(stubname, stub) 

我已經升級到sqlite的數據存儲,並需要更新存根(也許stubname) ,據推測與DatastoreSqliteStub,但似乎無法初始化它;有什麼建議麼 ?

謝謝!

+0

你能比「似乎無法初始化它」更具體嗎?當你嘗試時會發生什麼? –

回答

0

這裏是我的AppEngine項目的小模塊,我經常重複使用:ae.py

它讓我只是做:

import ae 
ae.connect_local_datastore() 

在腳本的頂部。或使用remote_api設置你也可以這樣做:

ae.connect_remote_datastore() 

一個簡單console.py腳本,利用這個可以發現here

希望他們幫助。