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?
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?
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:
template.render(jsonobj=JSONObj)
Then, in your template, you can use this object this way:
{{jsonobj.some_key_inside_json_object}}
This jsonobj is a name that identifies your "JSONObj" object inside the template's arguments.
Hope it helps!