在以下片段中,是resource
blob 键吗?
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 中检索图像?)。
谷歌教程链接:https ://developers.google.com/appengine/docs/python/blobstore/overview