On Wed, Aug 12, 2009 at 2:08 PM, Markus<pinky0...@googlemail.com> wrote:
>
> Hi,
>
> On Aug 11, 8:02 pm, NealWalters <nealwalt...@nealwalters.com> wrote:
>> This maybe what you are asking 
>> about?http://code.google.com/appengine/articles/remote_api.html
>
> indeed, this looks really good. :-)
>
> But the example doesn't work here.
> I'm running the guestbook example on localhost:8080 and want to access
> it with a client program.
>
> I have changed my helloworld  app.yaml to:
>
> application: helloworld
> version: 1
> runtime: python
> api_version: 1
>
> handlers:
> - url: /.*
>  script: helloworld.py
> - url: /remote_api
>  script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
>  login: admin

Handlers are processed in the order they're listed, and your first
handler catches everything. You need to put the remote_api handler
first.

Bear in mind, though, that remote_api should be used only in cases
where the people using it are trusted administrators of the app.
Giving access to remote_api gives complete access to your app.

>
> and the client code looks like:
>
> #!/usr/bin/python
> import code
> import getpass
> import sys
>
> sys.path.append("~/googleapp/google_appengine")
> sys.path.append("~/googleapp/google_appengine/lib/yaml/lib")
>
> from google.appengine.ext.remote_api import remote_api_stub
> from google.appengine.ext import db
>
> def auth_func():
>  return raw_input('Username:'), getpass.getpass('Password:')
>
> if len(sys.argv) < 2:
>  print "Usage: %s app_id [host]" % (sys.argv[0],)
> app_id = sys.argv[1]
> if len(sys.argv) > 2:
>  host = sys.argv[2]
> else:
>  host = 'localhost:8080'
>
> remote_api_stub.ConfigureRemoteDatastore(app_id, '/remote_api',
> auth_func, host)
>
> code.interact('App Engine interactive console for %s' % (app_id,),
> None, locals())
>
> But if i try to run the program i get this error message:
>
> $ python client.py helloworld
> Traceback (most recent call last):
>  File "client.py", line 9, in <module>
>    from google.appengine.ext.remote_api import remote_api_stub
> ImportError: No module named google.appengine.ext.remote_api
>
>
> Any idea what's wrong?
>
> Thanks!
> >
>



-- 
Nick Johnson, Developer Programs Engineer, App Engine

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to