更新时间:2023-11-20 22:18:07
假设
/ pictures / models\。(。*)/
然后你可以做类似于
class BlobstoreImageHandler(blobstore.handler.BlobstoreDownloadHandler):
def get (资源):
resourse = str(urllib.unquote(资源))
blob_info = blobstore.BlobInfo.get(资源)
self.send_blob(blob_info)
这是直接从 http://code.google.com/appengine/docs/python/blobstore/overview.html#Serving_a_Blob
i am using google app engine with django to make a small application that it has these features
well after finishing part 1 , now i am somewhere stuck in part 2 where i need to show images.
i did everything i retrieved the image keys, but the images are not showing.
only the titles of the images i saved in the datastore.
here is my code:
<ul>
{% for image in image.all %}
<li>{{ image.title }} </li>
<li> <img src="/pictures/models.{{image.key}}"/> </li>
{% endfor %}
</ul>
Assuming
/pictures/models\.(.*)/
Then you'd do something like
class BlobstoreImageHandler(blobstore.handler.BlobstoreDownloadHandler):
def get(self, resource):
resourse = str(urllib.unquote(resource))
blob_info = blobstore.BlobInfo.get(resource)
self.send_blob(blob_info)
which is straight out of http://code.google.com/appengine/docs/python/blobstore/overview.html#Serving_a_Blob