title: How to send sms otp to mobile number after signup using django rest api
body: <p>I have created django rest api for user sign up, with username, email, pasword and phone.Once user register with above details then user should receive sms otp and after we have to verify that otp for sign in, for these how to send sms using django rest api.</p>
  
  <p>Below code is for sign up</p>
  
  <pre><code>class Signup(APIView):
      permission_classes=[permissions.AllowAny]
      def post(self,request):
          import ipdb;ipdb.set_trace()
          response_dict = {"status": True, "message": "", "data": {}}
          try:
              username=request.data.get('username')
              email=request.data.get('email')
              password=request.data.get('password')
              phone = request.data.get('phone')
  
          user = User.objects.create_user(username=username,email=email,password=password)
          user.save()
          ud = UserDetail(user=user,phone=phone,created_by=request.user.id)
          ud.save()
          response_dict = {"status": True, "msg":"Successfully Registered"}
          return Response(response_dict)
              # messages.success(request, "User account has been successfully Registered!")
      except Exception as e:
          response_dict = {"status": False}
          return Response(response_dict)
  </code></pre>