"How to point my local dev_appserver to a non-emulated bucket at Google": it's not documented all that clearly, but it is implemented in the dev_appserver
and cloudstorage
.
To verify what I'm saying, first svn checkout http://appengine-gcs-client.googlecode.com/svn/trunk/python gcs-client
to get cloudstorage's source code onto your machine (you'll need to install subversion
if you don't have it already, but, that's free too:-).
Then, cd gcs-client/src/cloudstorage/
and look at storage_api.py
. In the very first function _get_storage_api
, the docstring says:
On dev appserver, this instance by default will talk to a local stub
unless common.ACCESS_TOKEN is set. That token will be used to talk
to the real GCS.
So, look at common.py
, and again in the first function, set_access_token
, you'll see:
Args:
access_token: you can get one by run 'gsutil -d ls' and copy the
str after 'Bearer'.
So there you are -- in every entry to your app (best in appengine_config.py
in your root directory), import cloudstorage
's common
module, then **if and only if you're on dev_appserver[*] call
common.set_access_token('whatever_the_token')
using as argument string the one you get by run 'gsutil -d ls', right after Bearer
i.e among much else you'll spot something like (faking and way shortening the actual value...:-):
Bearer xy15.WKXJQEzXPQQy2dt7qK9\r\n
in which case you'd be calling
common.set_access_token('xy15.WKXJQEzXPQQy2dt7qK9')
[*] many ways to find out if you're on dev_appserver
, e.g see GAE: python code to check if i'm on dev_appserver or deployed to appspot .