Right now I am working on setting up a simple API system on one of my web projects for writing to and reading from Google Cloud Storage (mostly for photo storage) yet I'm running into issues with some of the plugins while emulating in the App Engine environment.
I might start first by explaining how I got to this point. Initially, I looked right into the cloudstorage API provided by Google and attempted to use an extension which did something like this for saving files:
def _save(self, name, content):
filename = self.location + "/" + name # e.g. https://storage.googleapis.com/bucket/name
filename = os.path.normpath(filename)
filetype, encoding = mimetypes.guess_type(name)
gss_file = gcs.open(
GOOGLE_STORAGE = 'gs'
CLIENT_ID = '(my client id)'
CLIENT_SECRET = '(my client secret)'
BUCKET = '(my bucket name)'
def save_blob(directory, name, content):
dst_uri = boto.storage_uri(BUCKET + '/' + directory + name, GOOGLE_STORAGE)
print 'Successfully created "%s/%s"' % (dst_uri.bucket_name, dst_uri.object_name)
ImportError: no module named boto.
With help from @voscausa I tried some of the things I had attempted previously, but instead this time from within App Engine using the primary project with which I hold the Cloud Storage bucket. With this, I was able to write files with no problem. What I will probably do from here is just set up an API which I can use from my other projects to read and write files through the main project instead of trying to do it directly from my other projects. Thanks @voscausa for pointing me in the right direction! It really was this easy all along. I was just trying to make it harder for myself I suppose.