def user_media_path(what):
 default = os.path.join(settings.MEDIA_ROOT, what)
 key = '{0}_PATH'.format(what.upper())
 return getattr(settings, key, default)

def user_media_path ( what ) : default = os . path . join ( settings . MEDIA_ROOT , what ) key = '{0}_PATH' . format ( what . upper ( ) ) return getattr ( settings , key , default )
make it possible to override storage paths in settings .