title: cross domain json data rejected in django tastypie
body: <p>I have used django-tastypie using GET,POST,PUT,DELETE methods , they are working smoothly when   both client and server are from  same domain but if I make a request from different domain nothing happened at all. </p>
  
  <p>Any clue?</p>
  
  <p>models.py</p>
  
  <pre><code>from django.db import models
  class Entry(models.Model):
      title = models.CharField(max_length=30)
      body = models.CharField(max_length=40)
      pub_date = models.DateField()
      slug=models.CharField(max_length=30)
  </code></pre>
  
  <p>resources.py</p>
  
  <pre><code>from django.contrib.auth.models import User
  from tastypie.authorization import Authorization
  from tastypie import fields
  from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS  
  from myapp.models import Entry
  
  
  class UserResource(ModelResource):
      class Meta:
          queryset = User.objects.all()
          resource_name = 'user'
          excludes = ['email', 'password', 'is_active', 'is_staff', 'is_superuser']
          filtering = {
          'username': ALL,
          }
  
  
  class EntryResource(ModelResource):
  
      class Meta:
      queryset = Entry.objects.all()
      resource_name = 'entry'
      authorization = Authorization()
      filtering = {
          'user': ALL_WITH_RELATIONS,
          'pub_date': ['exact', 'lt', 'lte', 'gte', 'gt'],
          }
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>from django.views.generic.simple import direct_to_template
  from django.conf.urls.defaults import *
  from tastypie.api import Api
  from myapp.resources import EntryResource, UserResource
  
  v1_api = Api(api_name='v1')
  v1_api.register(UserResource())
  v1_api.register(EntryResource())
  
  urlpatterns = patterns('',
  # The normal jazz here...
       (r'^api/', include(v1_api.urls)),
       (r'^basic/$', direct_to_template, {'template': 'todos/test.html'})
  )
  </code></pre>
  
  <p>And template file is as below</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
      &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
      &lt;script language="javascript"&gt;
    jQuery(document).ready(function($) {
        var data = JSON.stringify({
        "body": "This will prbbly be my lst edited  post.",
        "pub_date": "2011-05-22T00:46:38",
         "slug": "another-post",
        "title": "Another Post",
  
       });
    $.ajax({
          url: "http://localhost:8000/api/v1/entry/1/?format=json",
          type: 'PUT',
              contentType: 'application/json',
          data: data,
          dataType: 'json',
          processData: false,
          success:function(data) { 
              alert(data);
              },
          error : function(data){
              alert('error')
              },  
          })
    }) 
  
   &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
  body content goes here 
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>now when i run <a href="http://localhost:8000/basic" rel="nofollow">http://localhost:8000/basic</a> it working perfectly for CRUD</p>
  
  <p>later i installed apache server and copied that basic.html. When I run <a href="http://localhost:81/basic.html" rel="nofollow">http://localhost:81/basic.html</a> then json data are not accepted by server. I have run both apache and python server parallelly.</p>