Guest User

Untitled

a guest
Mar 6th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. #!/usr/bin/python
  2. import code
  3. import getpass
  4. import logging
  5. import sys
  6.  
  7. logging.basicConfig(level=logging.INFO)
  8.  
  9. base_path = "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine"
  10. sys.path.append(base_path)
  11. sys.path.append(base_path + "/lib/yaml/lib")
  12. sys.path.append(base_path + "/lib/webob")
  13. sys.path.append(base_path + "/lib/django")
  14.  
  15. from google.appengine.ext.remote_api import remote_api_stub
  16. from google.appengine.ext import db
  17.  
  18. def auth_func():
  19. return raw_input('Username:'), getpass.getpass('Password:')
  20.  
  21. if len(sys.argv) < 2:
  22. print "Usage: %s app_id [host]" % (sys.argv[0],)
  23. app_id = sys.argv[1]
  24. if len(sys.argv) > 2:
  25. host = sys.argv[2]
  26. else:
  27. host = '%s.appspot.com' % app_id
  28.  
  29. remote_api_stub.ConfigureRemoteDatastore(app_id, '/remote_api', auth_func, host)
  30.  
  31. code.interact('App Engine interactive console for %s' % (app_id,), None, locals())
Add Comment
Please, Sign In to add comment