I trying to create a json object and pass that object to template.render(JSONObj), but there is some error saying
ValueError: dictionary update sequence element #0 has length 1; 2 is required
What am I doing wrong?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have to give that “JSONObj” object a key value. The template recieves a dictionary with objects and values to render inside it. So, try using this:
Then, in your template, you can use this object this way:
This
jsonobjis a name that identifies your “JSONObj” object inside the template’s arguments.Hope it helps!