title: Why I am getting global name 'http' is not defined error?
body: <p>I am using tastypie. When I want to post data to my server I am getting:</p>
  
  <p>"global name 'http' is not defined"</p>
  
  <p>Error message. </p>
  
  <p>My curl command is </p>
  
  <pre><code>curl --dump-header - -H "Content-Type: application/json" -X POST --data '{{"shop" : "/api/shop/1/","transactions" : [{"item" : "/api/item/53/","note" : "Normal"}]}' http://localhost:5000/api/order/
  </code></pre>
  
  <p>Traceback:</p>
  
  <pre><code>{"error_message": "global name 'http' is not defined", "traceback": "Traceback (most recent call last):\n\n  File \"/Users/burakkilic/Documents/Projects/FineDine/Server/Django/finedine/venv/lib/python2.7/site-packages/tastypie/resources.py\", line 195, in wrapper\n    response = callback(request, *args, **kwargs)\n\n  File \"/Users/burakkilic/Documents/Projects/FineDine/Server/Django/finedine/venv/lib/python2.7/site-packages/tastypie/resources.py\", line 426, in dispatch_list\n    return self.dispatch('list', request, **kwargs)\n\n  File \"/Users/burakkilic/Documents/Projects/FineDine/Server/Django/finedine/venv/lib/python2.7/site-packages/tastypie/resources.py\", line 458, in dispatch\n    response = method(request, **kwargs)\n\n  File \"/Users/burakkilic/Documents/Projects/FineDine/Server/Django/finedine/venv/lib/python2.7/site-packages/tastypie/resources.py\", line 1317, in post_list\n    deserialized = self.deserialize(request, request.body, format=request.META.get('CONTENT_TYPE', 'application/json'))\n\n  File \"/Users/burakkilic/Documents/Projects/FineDine/Server/Django/finedine/finedine/api.py\", line 203, in deserialize\n    raise ImmediateHttpResponse(response=http.HttpBadRequest(e.message))\n\nNameError: global name 'http' is not defined\n"}
  </code></pre>
  
  <p>I put the address in quotes, but nothing has changed.</p>
  
  <p>Also I wrote this to my resource:</p>
  
  <pre><code>def deserialize(self, request, data, format='application/json'):
      try:
          return super(OrderResource, self).deserialize(request, data, format=format)
      except Exception as e:
          # if an exception occurred here it must be due to deserialization
          raise ImmediateHttpResponse(response=http.HttpBadRequest(e.message))
  </code></pre>
  
  <p>What is the problem?</p>