(self)
configure plivo client

        we will provide to ways to configure clients :
         - One, you can configure plivo keys from environment variables if not,
         - Then Second, you ca send keys as function arguments too,
         - Priority wil be given to function arguments

        :return: plivo client instance
configure plivo client
configure plivo client
def _validate_configure_plivo(self):
        """configure plivo client

        we will provide to ways to configure clients :
         - One, you can configure plivo keys from environment variables if not,
         - Then Second, you ca send keys as function arguments too,
         - Priority wil be given to function arguments

        :return: plivo client instance
        """
        if self.auth_id is None:
            self.auth_id = getattr(settings, 'PLIVO_AUTH_ID', None)
        if self.auth_token is None:
            self.auth_token = getattr(settings, 'PLIVO_AUTH_TOKEN', None)

        if self.auth_id is None or self.auth_token is None:
            raise RuntimeWarning(
                'to send sms via {0} you need to configure PLIVO_AUTH_ID & PLIVO_AUTH_TOKEN in \n'
                'environment variables or send auth_id & auth_token as function arguments.'.format(self.name)
            )

        self.plivo_client = plivo.RestAPI(self.auth_id, self.auth_token)
def _validate_configure_plivo ( self ) : if self . auth_id is None : self . auth_id = getattr ( settings , 'PLIVO_AUTH_ID' , None ) if self . auth_token is None : self . auth_token = getattr ( settings , 'PLIVO_AUTH_TOKEN' , None ) if self . auth_id is None or self . auth_token is None : raise RuntimeWarning ( 'to send sms via {0} you need to configure PLIVO_AUTH_ID & PLIVO_AUTH_TOKEN in \n' 'environment variables or send auth_id & auth_token as function arguments.' . format ( self . name ) ) self . plivo_client = plivo . RestAPI ( self . auth_id , self . auth_token )