1 2 3 4 5 6 7 8 9 10 11 12 13 14 | from django import template
import urllib, hashlib
register = template.Library()
def gravatar(user, size=80):
gravatar_url = "http://www.gravatar.com/avatar.php?"
gravatar_url += urllib.urlencode({
'gravatar_id':hashlib.md5(user.email).hexdigest(),
'size':str(size)})
return """<img src="%s" alt="gravatar for %s" />""" % (gravatar_url, user.username)
register.simple_tag(gravatar)
|
More like this
- Gravatar support for Django comments by jonathan 3 years, 4 months ago
- Full Featured Gravatar Tag by ashcrow 3 years, 1 month ago
- Prefill ForeignKey caches by insin 3 years, 4 months ago
- Improved User Admin by gregb 1 year, 9 months ago
- Authenticate with Email Address by thom 4 years, 10 months ago
Comments