Skip to content

Tag: json

django ‘str’ object has no attribute ‘_meta’

Sorry for my English. I have some data from another server, but I need to output this data like JSON. if i print response in console: but, if i return this response like HttpResponse i have an error AttributeError: ‘str’ object has no attribute ‘_meta’ this my code: UPD: I tried with t…

How to add a newline function to JSON using Python

I have a JSON that I had to manipulate and the code looks like this. I had to manipulate the data because of an invalid part of the data that I could not use when uploading to BigQuery. However out_file.write(“n”) is not making the JSON write each set of data on a newline like it has in the previo…

Convert html source code to json object

I am fetching html source code of many pages from one website, I need to convert it into json object and combine with other elements in json doc. . I have seen many questions on same topic but non of them were helpful. My code: above code gives me unicode type, however, when I put that output in jsonLint it

Get label name on JSON Python

i am a newbie on JSON, I want to get just ‘label’ from my JSON data here is my JSON data, i am using json.dumps to turn it into JSON format I want to print just the label of my JSON data, is there any possible way to do it? The result that i want is Answer You must convert

how to parse json array in django

I am new in django rest api framework and using get i am fetching the a json array whose api is this https://api.coursera.org/api/courses.v1?q=search&query=machine+learning and i am not able to parse it.Actually i want to store all the names and send them to .html file .I have used this code but didnot wo…