Jump to >

djblets.gravatars.templatetags.gravatars

gravatar(parser, token)[source]

Output the HTML for displaying a user’s Gravatar.

This can take an optional size of the image (defaults to 80 if not specified).

This is also influenced by the following settings in settings.py:

GRAVATAR_SIZE:
Default size for Gravatars.
GRAVATAR_RATING:
Maximum allowed rating. This should be one of: g, pg, r, x
GRAVATAR_DEFAULT:
Default image set to show if the user hasn’t specified a Gravatar. This should be one of: identicon, monsterid, wavatar

See https://www.gravatar.com/ for more information.

Parameters:
Returns:

The HTML for displaying the Gravatar.

Return type:

unicode

gravatar_url(parser, token)[source]

Output the URL for a Gravatar for the given email address.

This can take an optional size of the image (defaults to 80 if not specified).

This is also influenced by the following settings in settings.py:

GRAVATAR_SIZE:
Default size for Gravatars.
GRAVATAR_RATING:
Maximum allowed rating. This should be one of: g, pg, r, x
GRAVATAR_DEFAULT:
Default image set to show if the user hasn’t specified a Gravatar. This should be one of: identicon, monsterid, wavatar

See https://www.gravatar.com/ for more information.

Parameters:
Returns:

The HTML for displaying the Gravatar.

Return type:

unicode