I was able to do this by copying some of the RPC code from appcfg.py into my application. I published this meaning , which talks in detail about how to do this, but I will repeat them here for posterity.
- Install python API client . This will give you the OAuth2 and httplib2 libraries needed to interact with Google RPC servers from your application.
- Copy this file from the GAE SDK installed on your development machine:
google/appengine/tools/appengine_rpc_httplib2.py into your GAE web application. - Get the update token by running
appcfg.py list_versions . --oauth2 appcfg.py list_versions . --oauth2 from your local computer. This will open a browser so you can log in to your Google account. Then you can find refresh_token in ~ / .appcfg_oauth2_tokens - Modify and run the following code inside the web handler:
Enjoy.
from third_party.google_api_python_client import appengine_rpc_httplib2
source share