在我看来,我正在尝试循环所有页面并使用下面的代码为每个页面提取名称。但它似乎不起作用。
我怎样才能做到这一点?
视图.py
 json_dict = json.loads(request.POST['site'])
  for item in json_dict['pages']:
            item.json_dict['name']
JSON数据
{
    "someitem": "xaAX",
    "pages": [
        {
            "id": "1364484811734",
            "name": "Page Name",
            "type": "basic",
            "components": {
                "img": "",
                "text": ""
            }
        },
        {
            "id": "1364484812918",
            "name": "Contact",
            "type": "contact",
            "components": {
                "text": "Send us an email using the form below.",
                "contact-form": {
                    "contact-name": "zzz",
                    "contact-email": "zz"
                }
            }
        },
    ]
}