我正在将应用程序从 Python 2.5 切换到 2.7,并且开始遇到图像服务问题。例如,使用 db.put() 保存此实体:
from google.appengine.api import images
class Images(db.Expando):
ImageTitle = db.StringProperty()
ImageFile = blobstore.BlobReferenceProperty()
ImageReference = db.StringProperty()
def put(self, **kwargs):
if not self.ImageReference:
self.ImageReference = images.get_serving_url(self.ImageFile.key())
super(Images, self).put(**kwargs)
现在产生此错误:
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1536, in __call__
rv = self.handle_exception(request, response, e)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1530, in __call__
rv = self.router.dispatch(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1102, in __call__
return handler.dispatch()
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 572, in dispatch
return self.handle_exception(e, self.app.debug)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 570, in dispatch
return method(*args, **kwargs)
File "C:\Users\VB User\Bruha\src\handler_product_page_image.py", line 40, in post
image.put()
File "C:\Users\VB User\Bruha\src\db_models.py", line 56, in put
self.ImageReference = images.get_serving_url(self.ImageFile.key())
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\images\__init__.py", line 1792, in get_serving_url
rpc = get_serving_url_async(blob_key, size, crop, secure_url, filename, rpc)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\images\__init__.py", line 1907, in get_serving_url_async
None)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\images\__init__.py", line 1034, in _make_async_call
rpc = create_rpc()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\images\__init__.py", line 1028, in create_rpc
return apiproxy_stub_map.UserRPC("images", deadline, callback)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\apiproxy_stub_map.py", line 405, in __init__
self.__rpc = CreateRPC(service, stubmap)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\apiproxy_stub_map.py", line 69, in CreateRPC
'a CreateRPC method.') % service)
AssertionError: The service "images" doesn't have a CreateRPC method.
调用 'execute_transforms' 方法也会产生相同的错误。
任何帮助了解正在发生的事情将不胜感激。