title: Django, how to get a user by id, using the django.contrib.auth.models.User
body: <p>I cant'figure it out how to get a User, from the django model, django.contrib.auth.models.User, by id... I want to delete a user so I'm trying to find it like that:</p>
  
  <pre><code> User.objects.get(id=request.POST['id'])
  </code></pre>
  
  <p>But it doesn work, and returns</p>
  
  <pre><code>User matching query does not exist.
  </code></pre>
  
  <p>the id is sent by ajax:</p>
  
  <pre><code> $("#dynamic-table").on('click','.member_delete_btn', function() {
          if (confirm("Are you sure? the member will be deleted...") == true) {
              $.ajax({
                  type: "POST",
                  url: "/panel/member/delete/",
                  data: { id: $(this).attr('data-id'), 'csrfmiddlewaretoken': '{{ csrf_token }}' },
                  success: function (data) {
                       if(data.success) {
                           $('#result').html('&lt;div class="alert alert-success"&gt; &lt;strong&gt;Well done!&lt;/strong&gt; Member deleted.&lt;/div&gt;');
                           list_members();
                       }else{
                           $('#result').html('&lt;div class="alert alert-warning"&gt; &lt;strong&gt;Warning!&lt;/strong&gt; Member not deleted.&lt;/div&gt;');
                       }
                  },
                  error: function (data) {
                      alert("failure:" + data.error);
                  }
              });
          }
          else {
              return false;
          }
          return false;
      });
  </code></pre>
  
  <p>I debug it and it's ok, the user exists in the DB and the id is correct</p>
  
  <p>How do I do that? 
  Is there any delete method for django User instances?</p>
  
  <p>thanks</p>