title: Django form submit with ajax form.serialize()
body: <p><strong>views.py</strong></p>
  
  <pre><code>def login(request):
          password = request.POST.get('password')
          mobile = request.POST.get('mobile')
          user = authenticate(username=mobile, password=password)
          if user is not None:
              if user.is_active:
                  login(request, user)
                  return HttpResponseRedirect("/owner/?own=" + str(user.id))
  </code></pre>
  
  <p><strong>login.html</strong></p>
  
  <pre><code>$('.login-form').on('submit', function(event) {
          event.preventDefault();
          var form = $(this);
          $.ajax({
              url: '/ajax/login/',
              type: "POST",
              data: form.serialize()
            success: function(data) {
   });
  });
  </code></pre>
  
  <p>i'm getting error:</p>
  
  <p>Method Not Allowed (POST): /
  Method Not Allowed: /
  [20/Oct/2018 04:41:30] "POST / HTTP/1.1" 405 0</p>