djblets.gravatars¶
Utilities for working with gravatars.
- get_gravatar_url_for_email(email=None, size=None)[source]¶
Return the Gravatar URL for an e-mail address.
The returned URL will always use HTTPS.
Note that callers adhering to the GDPR should check for a user’s consent before displaying a Gravatar on their behalf. This is checked automatically if using
djblets.avatars
.
- get_gravatar_url(user=None, size=None)[source]¶
Return the Gravatar URL for a user.
The returned URL will always use HTTPS.
Note that callers adhering to the GDPR should check for a user’s consent before displaying a Gravatar on their behalf. This is checked automatically if using
djblets.avatars
.- Parameters:
user (
django.contrib.auth.models.User
) – The user whose Gravatar URL is to be retrieved.size (
int
, optional) – An optional height and width of the image (in pixels).
- Returns:
The URL for the user’s Gravatar.
- Return type:
- Raises:
ValueError – Raised if
user
isNone
.