def _swap_settings(new):
 settings = django.conf.settings
 old = {}
 for (key, value) in new.iteritems():
  old[key] = getattr(settings, key, None)
  setattr(settings, key, value)
 return old

def _swap_settings ( new ) : settings = django . conf . settings old = { } for ( key , value ) in new . iteritems ( ) : old [ key ] = getattr ( settings , key , None ) setattr ( settings , key , value ) return old
swap in selected django settings .