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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With