I have a python GAE application, with an ndb datastore storing images as a blob property.
I use get_serving_url()
function to serve images, and it works properly on the Google App Engine production server ("my-app".appspot.com).
When i try it on localhost, the URL seems to be generated correctly, but if I click on it I receive a blank page.
Is it normal, because GAE does not implement it on localhost, or it's a problem of my development environment? Anyway: is there a way to make it works on localhost? I didn't find any information on the web.
Thank you.
update
Some additional details: all the upload process work correctly, I see the uploaded image in the blobstore viewer, and its url is something like localhost:8000/*blob-key*?display=inline
.
When i call get_serving_url()
on localhost, i obtain an url like localhost:8080/_ah/img/*blob-key*
and it does not work (blank page). I just discovered that on Log Console I receive this message:
ERROR 2013-12-30 11:52:14,299 module.py:665] Request to '/_ah/img/vMDNz9x9ak9VcjBXmfMBcg==' failed
Traceback (most recent call last): File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\module.py", line 661, in _handle_request return handler.handle(match, environ, wrapped_start_response) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\wsgi_handler.py", line 59, in handle return self._wsgi_app(environ, start_response) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\blob_image.py", line 195, in call return self.serve_image(environ, start_response) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\blob_image.py", line 184, in serve_image image, mime_type = self._transform_image(blobkey, options) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\blob_image.py", line 68, in _transform_image image = _get_images_stub()._OpenImageData(image_data)
AttributeError: 'ImagesNotImplementedServiceStub' object has no attribute '_OpenImageData'
Anyway, when i deploy on the production server, the get_serving_url()
produce something like lh6.ggpht.com/*longer-blob-key*
that points on Google servers and works correctly.