Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud Storage with get_serving_url

I want to serve image files on Google Cloud Storage with Images API get_serving_url. Can get_serving_url accept files on Google Cloud Storage?

I tried:

from google.appengine.api import blobstore
from google.appengine.api import images
bkey = blobstore.create_gs_key('/gs/bucket/object')
url = images.get_serving_url(bkey)

A error InvalidBlobKeyError occured on get_serving_url in production environment.

like image 540
najeira Avatar asked May 02 '12 14:05

najeira


2 Answers

Everybody would love that, and since 1.7.0 version it is possible!

You can use the get_serving_url() for Google Cloud Storage buckets.

like image 170
Lipis Avatar answered Nov 14 '22 15:11

Lipis


Just as of GAE 1.6.5, the images.Image class constructor can take as an argument a GCS file name, e.g.

 img = images.Image(filename='/gs/bucket/object')

You can then execute transforms on that object and serve it up, etc.

like image 5
Amy U. Avatar answered Nov 14 '22 15:11

Amy U.