def get_gravatar(self):
"""Creates gravatar URL from email address."""
m = hashlib.md5()
m.update(self.user.email())
encoded_hash = base64.b16encode(m.digest()).lower()
return 'https://gravatar.com/avatar/{}?s=200'.format(encoded_hash)
评论列表
文章目录