Send SMS using Django-Python


  • Python
  • Django
    • 2
    • IN
    • Verified
    • Posted byProud
    • TimeAug. 14, 2022, 4:32 p.m.
    • StatusActive

    Snippet Description

    Create a separate file name it as sms_worker.py or any. Add this code to your file. Send the message by just calling the function and providing params..

    Code

      import requests

      base_url ="http://url/api/v4/?api_key=API_KEY&sender=SENDER&method=sms&"

      def otp_reg_cmd(mobile):
          sms = "Message"  # Sample-Message
          url =  base_url+"message="+sms+"&to="+mobile
          req = requests.get(url)

    Comments

    Related Posts

    PWADHWA

    Send SMS using Django-Python

    Python Django

    2 Aug. 14, 2022, 4:32 p.m.
    Proud

    Create Superuser in Django

    Python Django

    4 March 18, 2022, 5:42 p.m.
    PPPP

    Want to Hire our experts?

    We'll help you to grow your career and growth.
    SignUp Today