def add_settings(mod, settings):
 for setting in dir(mod):
  if (not setting.isupper()):
   continue
  setting_value = getattr(mod, setting)
  if ((setting in ('INSTALLED_APPS', 'TEMPLATE_DIRS')) and isinstance(setting_value, six.string_types)):
   setting_value = (setting_value,)
  if (setting[:6] == 'EXTRA_'):
   base_setting = setting[6:]
   if isinstance(getattr(settings, base_setting), (list, tuple)):
    curval = getattr(settings, base_setting)
    setattr(settings, base_setting, (curval + type(curval)(setting_value)))
    continue
  setattr(settings, setting, setting_value)

def add_settings ( mod , settings ) : for setting in dir ( mod ) : if ( not setting . isupper ( ) ) : continue setting_value = getattr ( mod , setting ) if ( ( setting in ( 'INSTALLED_APPS' , 'TEMPLATE_DIRS' ) ) and isinstance ( setting_value , six . string_types ) ) : setting_value = ( setting_value , ) if ( setting [ : 6 ] == 'EXTRA_' ) : base_setting = setting [ 6 : ] if isinstance ( getattr ( settings , base_setting ) , ( list , tuple ) ) : curval = getattr ( settings , base_setting ) setattr ( settings , base_setting , ( curval + type ( curval ) ( setting_value ) ) ) continue setattr ( settings , setting , setting_value )
adds all settings that are part of mod to the global settings object .