Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7074805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:06:08+00:00 2026-05-28T06:06:08+00:00

I have Django project on Dreamhost server which has several views that returns Json

  • 0

I have Django project on Dreamhost server which has several views that returns Json response.Yesterday I have ported my Django project from local machine(localhost) to dreamhost server running apache.Now if I call my django view through jquery for

http://www.abc.com/projects/

It should return me all projects that i have in my mongodb database but instead of that it returns :

On Firefox – just headers with no response

Connection  Keep-Alive
Content-Type    application/json
Date    Thu, 19 Jan 2012 09:03:34 GMT
Keep-Alive  timeout=2, max=100
Server  Apache
Status  200 OK
Transfer-Encoding   chunked

On Chrome – No headers and response data.It throws an error:

XMLHttpRequest cannot load http://abc.com/Projects/. Origin null is not allowed by Access-Control-Allow-Origin.**

If I just access the http://www.abc.com/projects/ through my web-browser it returns me results in json format,but not in case if I use JavaScript/Jquery.

Earlier I was using this middleware to allow other domains to request and get response on my local-machine with django in-built server.But now when I am running on apache server It stops working so I removed It from Settings.py file.

I don’t know why is this error coming .Please help

*EDIT*

As @burhan suggested I used jsonp on client side and now my server is returning json but browser is giving error before parsing it.Error is : unexpected token

JSON i am getting in reply is :

{"projects": [{"projectName": "carmella", "projectId": "4f13c7475fcff30710000000"}, {"projectName": "SeaMonkey", "projectId": "4f1677b75fcff37c03000001"}]}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:06:08+00:00Added an answer on May 28, 2026 at 6:06 am

    You are running into the same origin policy sandbox. Since your server is http://www.abc.com and you are accessing abc.com – the origin is not the same, which is why the script is not executing.

    You have a few options:

    1. Make sure the URL matches exactly – to avoid the same origin policy sandbox.
    2. Use jsonp in your javascript libary.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a django project that runs on a Linux server, and I've been
I have a Django project in Eclipse PyDev. I have a file views.py which
I have a django project that uses views from an external app. The view
I have a Django project which has two apps (one created as debug test).
I have a Django project, that has a Address model. This is used in
I have a Django project that works fine with the development server that comes
I have a django project that works fine with the embedded server, but when
I have a django project which has two apps, one is AppA and AppB
I have a Django project in which multiple processes are accessing the backend mysql
I have a django project that I have been working on as a solo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.