def get_env_setting(setting):
 try:
  return environ[setting]
 except KeyError:
  error_msg = ('Set the %s env variable' % setting)
  raise ImproperlyConfigured(error_msg)

def get_env_setting ( setting ) : try : return environ [ setting ] except KeyError : error_msg = ( 'Set the %s env variable' % setting ) raise ImproperlyConfigured ( error_msg )
get the environment setting or return exception .