def get_profile_configs(profile=None, use_cache=True):
if use_cache and profile in _profile_configs_cache:<EOL><INDENT>return _profile_configs_cache[profile]<EOL><DEDENT>profile_conf = None<EOL>if profile is not None:<EOL><INDENT>try:<EOL><INDENT>profile_conf = dju_settings.DJU_IMG_UPLOAD_PROFILES[profile]<EOL><DEDENT>except KeyError:<EOL><INDENT>if profile != '<STR_LIT:default>':<EOL><INDENT>raise ValueError(unicode(ERROR_MESSAGES['<STR_LIT>']) % {'<STR_LIT>': profile})<EOL><DEDENT><DEDENT><DEDENT>conf = copy.deepcopy(dju_settings.DJU_IMG_UPLOAD_PROFILE_DEFAULT)<EOL>if profile_conf:<EOL><INDENT>conf.update(copy.deepcopy(profile_conf))<EOL>for v_i in xrange(len(conf['<STR_LIT>'])):<EOL><INDENT>v = conf['<STR_LIT>'][v_i]<EOL>conf['<STR_LIT>'][v_i] = copy.deepcopy(dju_settings.DJU_IMG_UPLOAD_PROFILE_VARIANT_DEFAULT)<EOL>conf['<STR_LIT>'][v_i].update(v)<EOL><DEDENT><DEDENT>if use_cache:<EOL><INDENT>_profile_configs_cache[profile] = conf<EOL><DEDENT>return conf<EOL>
Returns upload configs for profile.