This is how i am passing a json object in views.py
json_data = json.dumps(filedata, default=lambda obj: obj.__dict__,indent=4)
return HttpResponse(json_data, mimetype='application/json')
And I am reading the file in jquery using ajax...
$.ajax({
type: "GET",
url: "http://127.0.0.1:8000/project/defparser/",
dataType: "jsonp",
success: function(data) {
alert('Fetched ' + data.length + ' items!');
});
But its showing an error saying data is null in the browser... There is a problem of cross domain restriction because i am accessing a django server file from a standalone html file.... How to resolve it????