def GenerateDjangoKey(config):
 try:
  secret_key = config['AdminUI.django_secret_key']
 except ConfigParser.NoOptionError:
  secret_key = 'CHANGE_ME'
 if ((not secret_key) or (secret_key.strip().upper() == 'CHANGE_ME')):
  key = utils.GeneratePassphrase(length=100)
  config.Set('AdminUI.django_secret_key', key)
 else:
  print 'Not updating django_secret_key as it is already set.'

def GenerateDjangoKey ( config ) : try : secret_key = config [ 'AdminUI.django_secret_key' ] except ConfigParser . NoOptionError : secret_key = 'CHANGE_ME' if ( ( not secret_key ) or ( secret_key . strip ( ) . upper ( ) == 'CHANGE_ME' ) ) : key = utils . GeneratePassphrase ( length = 100 ) config . Set ( 'AdminUI.django_secret_key' , key ) else : print 'Not updating django_secret_key as it is already set.'
update a config with a random django key .