title: how get a django ajax post user
body: <p>i am designing a blog using django 1.5 .
  for the comment function,i am planning use ajax post json data to server.
  in my blog only registered user can post comment,that means all users are logged in </p>
  
  <p>i use angularjs 1.2 $http in page to post ajax data</p>
  
  <p>as i do not know much about json  .in the json data ,i only post the comment data ,not include other user info .my question is ,can i get the user object use this code </p>
  
  <pre><code>user = User.objects.get(user=request.user)
  </code></pre>
  
  <p>in this way ,i will know who post this comment.
  if it can not ,how can i  fetch the user object in django .
  in other place i see people use this way </p>
  
  <pre><code>&lt;input type="hidden" name="user_id" value="{{ user.id }}" /&gt;
  </code></pre>
  
  <p>and post the user.id with ajax.
  i do not think that is a good way .</p>
  
  <p>any one knows a better solution</p>