Its important to write example code that highlights your problem but doesn't get bogged down in extraneous details. With the example, we have a better understanding of the problem and can write an answer without a lot of extra explanation.
In your case, the question is puzzling because you don't update JSON directly (its just a string) - you load it into python and update the python objects. There are lots of other questions such as where did this json come from but they are not central to the issue of updating.
I took the liberty of writing an example that I hope is right
import json
json_str = """{
"blogs": [
{
"header": "Welcome",
"author": "Auriga",
"team" : "Webmaster",
"date" : ["2015", "12", "12"],
"paragraphs" : [
"Blah blah blah"
],
"images": []
}
]}"""
data = json.loads(json_str)
newblog = {
"header": "Welcome",
"author": "Auriga",
"team": "Webmaster",
"date": ["2015", "12", "12"],
"paragraphs" : [
"Blah blah blah"
],
"images": []
}
# THE PROBLEM: How do I add the new blog to blogs?
????
print(json.dumps(data, indent=4))
and the answer is simply data['blogs'].append(newblog)
import json
json_str = """{
"blogs": [
{
"header": "Welcome",
"author": "Auriga",
"team" : "Webmaster",
"date" : ["2015", "12", "12"],
"paragraphs" : [
"Blah blah blah"
],
"images": []
}
]}"""
data = json.loads(json_str)
newblog = {
"header": "Welcome",
"author": "Auriga",
"team": "Webmaster",
"date": ["2015", "12", "12"],
"paragraphs" : [
"Blah blah blah"
],
"images": []
}
# THE PROBLEM: How do I add the new blog to blogs?
data['blogs'].append(newblog)
print(json.dumps(data, indent=4))