mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
Allow to customize AVATAR_STORAGE settings
This commit is contained in:
parent
fc3dc002da
commit
875d24d9da
2 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue