在以下片段中,blob键是resource
吗?
from google.appengine.ext import blobstore
from google.appengine.ext.webapp import blobstore_handlers
class ServeHandler(blobstore_handlers.BlobstoreDownloadHandler):
def get(self, resource):
resource = str(urllib.unquote(resource))
blob_info = blobstore.BlobInfo.get(resource)
self.send_blob(blob_info)
app = webapp2.WSGIApplication([('/', MainHandler),
('/upload', UploadHandler),
('/serve/([^/]+)?', ServeHandler)],
debug=True)
如果我想从服务器调用blobstore(与外部调用者调用ServeHandler
相反),我该怎么做?基本上我希望我的后端检索blob_key(来自我的数据存储区),然后从blob_store获取图像(或者后端是否有另一种方法从blobstore中检索图像?)。
链接到Google教程:https://developers.google.com/appengine/docs/python/blobstore/overview