Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
230 views
in Technique[技术] by (71.8m points)

python - Remote_api configuration with App Engine

Using Python, I'm trying to connect to my AppEngine app's remote_api handler, but I keep getting an error. What I want to do is set up the remote_api stubs to route database calls through that and access my app's datastore directly. So, first, I import the remote_api libraries, then call the ConfigureRemoteApi on the stub module, and try to use the calls to the remote datastore. Here's some sample code:

from google.appengine.ext.remote_api import remote_api_stub

def test_remote_api():
    # This function is called when I want to use the remote api instead of the local datastore access
    remote_api_stub.ConfigureRemoteApi('myapp.appspot.com', '/_ah/remote_api', auth_func, '')

def auth_func:
    # This actually returns a tuple with my credentials to skip the console input
    return ('username', 'password')

Ok, now, I've tested my login information and the app name with remote_api_shell.py, but I get an error like this:

File "C:Program Files(x86)Googlegoogle_appenginegoogleappengineoolsdev_appserver_blobstore.py", line 79, in GetBlobStorage
return apiproxy_stub_map.apiproxy.GetStub('blobstore').storage
AttributeError: 'RemoteStub' object has no attribute 'storage'

And then I get a 404: Not Found from the application, which I know to be wrong since accessing the app from the Web does give me the result. What do I need to do to set up the remote_api_stub so I won't get this error?

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...