title: Django tastypie post request getting 401
body: <p>I am trying to do a POST request using tastypie in django.</p>
  
  <p>My Resource looks like below:</p>
  
  <pre><code>class TestResource(ModelResource):
      class Meta:
          queryset = Test.objects.all()
          resource_name = 'test'
          serializer = Serializer(formats=['json','xml'])
          always_return_data = True
          detail_allowed_methods = ['get', 'post', 'put', 'delete']
  </code></pre>
  
  <p>And I am posting data like below:</p>
  
  <pre><code>import sys
  import requests
  
  
  DATA = {'field1':'posting data', 'field2':'123', 'field3':330303,}
  
  def post(data):
      url = 'http://127.0.0.1:8000/api/test/'
      logging = {'verbose':sys.stderr}
      response = requests.post(url,data=data,config=logging)
      print "RESPONSE STATUS", response.status_code
      print "RESPONSE HEADERS", response.headers
  
  
  
  if __name__=='__main__':
      post(DATA)
  </code></pre>
  
  <p>I am always getting 401, any idea?
  What I am doing wrong?</p>
  
  <p>Thanks in advance.</p>