1
일부 JSON을보기에 게시합니다. 이제 데이터를 구문 분석하여 데이터베이스에 추가하려고합니다.장고보기에서 JSON을 구문 분석하는 방법
속성 name
및 theme
을 가져와 pages
배열을 반복해야합니다. 다음과 같이 내 JSON은 다음과 같습니다
{
"name": "xaAX",
"logo": "",
"theme": "b",
"fullSiteLink": "http://www.hello.com",
"pages": [
{
"id": "1364484811734",
"name": "Page Name",
"type": "basic",
"components": {
"img": "",
"text": ""
}
},
{
"name": "Twitter",
"type": "twitter",
"components": {
"twitter": {
"twitter-username": "zzzz"
}
}
}
]
}
내가 지금까지 무엇을 가지고 :
def smartpage_create_ajax(request):
if request.POST:
# get stuff and loop over each page?
return HttpResponse('done')