How to go through a Django dictionary in HTML template

103
April 11, 2022, at 04:10 AM

Im new to Django and I don't really have a clear idea how the Django Template language works but I have a dictionary that is something like this:

{
  "info":{
     "a":"test1",
     "b":"test2",
  }
}

How can I get the values for "a" and "b" in Django template. I'm not sure if that makes sense but what I mean would look something like this in Python:

for i in info:
  print(info.i)

I already tried this but it didn't work

{%for i in info %}
   {% if info.i %}
      console.log('{{info.i}}')
   {% endif %}
{% endear %}
Rent Charter Buses Company
READ ALSO
Python/increase code efficiency about multiple columns filter

Python/increase code efficiency about multiple columns filter

I was wondering if someone could help me find a more efficiency way to run my code

127
How to groupby a column and count the number of unique values in another column

How to groupby a column and count the number of unique values in another column

I have the following dataframeI need to groupby the ngram, and for each group, count how many unique documents are present in the DocID column

109