title: Twilio with Django for OTP
body: <p>I am trying to verify phonenumbers and send an otp to them in django but I get this error 400 Client Error: BAD REQUEST for url: <a href="https://api.twilio.com/2010-04-01/Accounts/ACb72b622666f57139034b55062d3bbe9c/Messages.json" rel="nofollow noreferrer">https://api.twilio.com/2010-04-01/Accounts/ACb72b622666f57139034b55062d3bbe9c/Messages.json</a> Please what could I be doing wrong.</p>
  
  <p>THe message from twilio is:</p>
  
  <pre><code>{"first_page_uri": "/2010-04-01/Accounts/ACb72b622666f57139034b55062d3bbe9c/Messages.json?PageSize=50&amp;Page=0", "end": 0, "previous_page_uri": null, "messages": [], "uri": "/2010-04-01/Accounts/ACb72b622666f57139034b55062d3bbe9c/Messages.json?PageSize=50&amp;Page=0", "page_size": 50, "start": 0, "next_page_uri": null, "page": 0}
  </code></pre>
  
  <p>This is my register function in view.py</p>
  
  <pre><code>def otp_register(request):
      if request.method == 'POST':
          form = RegistrationForm(request.POST)
          if form.is_valid():
              user = form.save()
              phone_number = form.cleaned_data.get('phone_number')
              if user.id:
                  user.twiliosmsdevice_set.create(name='SMS', number=phone_number)
                  device = user.twiliosmsdevice_set.get()
                  device.generate_challenge()
              return HttpResponseRedirect('/Nittanfund/verify')
      else:
          form = RegistrationForm()
      context = {}
      context.update(request)
      context['form'] = form
      return render(request, 'signup.html', context)
  </code></pre>