Jump to >

This documentation covers the in-development release of Djblets. You can see the latest stable docs or all previous versions.


An avatar service for setting absolute URLs for avatars.

class URLAvatarService(settings_manager_class)[source]

Bases: djblets.avatars.services.base.AvatarService

An avatar service for settings absolute URLs for avatars.

This avatar service is not available to users and is meant to be used by bots from extensions to provide their own avatars.

Automation users can be configured to use this service with the following code:

from djblets.avatars.services import URLAvatarService

avatar_services = get_avatar_service_registry()
service = avatar_services.get_avatar_service(

        '1x': 'http://example.com/static/avatar.png',
        '2x': 'http://example.com/static/avatar@2x.png',
avatar_service_id = u'url'[source]
name = u'URL Avatar Service'[source]
hidden = True[source]
setup(user, urls)[source]

Set up this avatar service for the given user.

The user will be configured to use this service as their avatar service and the given URLs will be used for their avatars.

get_avatar_urls_uncached(user, size)[source]

Return the avatar URLs for the requested user.


A dictionary mapping resolutions (‘1x’, ‘2x’, etc.) to the user’s avatar URLs.

Return type:



Return the ETag data for the user’s avatar.

Parameters:user (django.contrib.auth.models.User) – The user.
Returns:The uniquely identifying information for the user’s avatar.
Return type:list of unicode