I have a django view that returns HTTP 301 on a curl request:
grapefruit:~ pete$ curl -I http://someurl HTTP/1.1 301 MOVED PERMANENTLY Date: Fri, 16 Oct 2009
My problem was PREPEND_WWW, when using it in localhost it returns a 301 error, I just created a local settings file and set it PREPEND_WWW = False