def make_upload_path instance filename fn sha_constructor instance use

1
2
3
def make_upload_path(instance, filename):
fn = sha_constructor(instance.username).hexdigest()
return '%s/%s.jpg' % (os.path.join(MEDIA_ROOT, 'images/avatars'), fn)