开发者

google app engine if images not found set default images

I follow the tutorial on the google app engine Using the images python API http://code.google.com/appengine/docs/python/images/usingimages.html, my question is that how do I modify the code

if greeting.avatar:
    self.response.headers['Content-Type'] = "image/png"
    self.response.out.write(greeting.avatar)
else:
    self.error开发者_如何学运维(404)

instead of displaying error, how to I display a default image (static jpeg etc)?


self.redirect("path/to/static/image")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜