Allow to customize AVATAR_STORAGE settings

This commit is contained in:
kurmaev 2014-12-30 19:41:20 +06:00
parent fc3dc002da
commit 875d24d9da
2 changed files with 2 additions and 1 deletions

View file

@ -8,6 +8,7 @@ class AvatarConf(AppConf):
DEFAULT_SIZE = 80
RESIZE_METHOD = Image.ANTIALIAS
STORAGE_DIR = 'avatars'
STORAGE_PARAMS = {}
GRAVATAR_FIELD = 'email'
GRAVATAR_BASE_URL = 'http://www.gravatar.com/avatar/'
GRAVATAR_BACKUP = True

View file

@ -20,7 +20,7 @@ except ImportError:
now = datetime.datetime.now
avatar_storage = get_storage_class(settings.AVATAR_STORAGE)()
avatar_storage = get_storage_class(settings.AVATAR_STORAGE)(**settings.AVATAR_STORAGE_PARAMS)
def avatar_file_path(instance=None, filename=None, size=None, ext=None):