If I render a template using this document:
{ "a": 1, "b": 2 }
In Django templates, I can render html using the value of "a" like this:
{{ a }}
But is it possible to send the whole document to a template tag? ie, all this?
{ "a": 1, "b": 2 }
So that my tag can access arbitrary elements?
Just pass your dict as string or you can use json to this for you.
Example 1
Example 2
and inside your template just do like this