code: def send_sms_with_callback_token(user, mobile_token, **kwargs):
      
      base_string = kwargs.get('mobile_message', api_settings.PASSWORDLESS_MOBILE_MESSAGE)
  
      try:
  
          if api_settings.PASSWORDLESS_MOBILE_NOREPLY_NUMBER:
              # We need a sending number to send properly
              if api_settings.PASSWORDLESS_TEST_SUPPRESSION is True:
                  # we assume success to prevent spamming SMS during testing.
                  return True
  
              from twilio.rest import Client
              twilio_client = Client(os.environ['TWILIO_ACCOUNT_SID'], os.environ['TWILIO_AUTH_TOKEN'])
              twilio_client.messages.create(
                  body=base_string % mobile_token.key,
                  to=getattr(user, api_settings.PASSWORDLESS_USER_MOBILE_FIELD_NAME),
                  from_=api_settings.PASSWORDLESS_MOBILE_NOREPLY_NUMBER
              )
              return True
          else:
              logger.debug("Failed to send token sms. Missing PASSWORDLESS_MOBILE_NOREPLY_NUMBER.")
              return False
      except ImportError:
          logger.debug("Couldn't import Twilio client. Is twilio installed?")
          return False
      except KeyError:
          logger.debug("Couldn't send SMS."
                    "Did you set your Twilio account tokens and specify a PASSWORDLESS_MOBILE_NOREPLY_NUMBER?")
      except Exception as e:
          logger.debug("Failed to send token SMS to user: {}. "
                    "Possibly no mobile number on user object or the twilio package isn't set up yet. "
                    "Number entered was {}".format(user.id, getattr(user, api_settings.PASSWORDLESS_USER_MOBILE_FIELD_NAME)))
          logger.debug(e)
          return False
docs: Sends a SMS to user.mobile via Twilio.
  
      Passes silently without sending in test environment.