title: jinja2 fastapi, output dict to html not showing results
body: <p>i am trying to pass my searched result to a html page with jinja2 from fastapi.</p>
  <p>here is my back end</p>
  <pre><code>@app.get(&quot;/api/search&quot;)
  async def get_card_price(request: Request, card_search_keyword: str):
      card_results = await get_card_price(card_search_keyword)
      return templates.TemplateResponse(&quot;results.html&quot;, {&quot;request&quot;: request,
                                                         &quot;card&quot;: card_results[&quot;card&quot;],
                                                         &quot;card2&quot;: card_results[&quot;card2&quot;]})
  </code></pre>
  <p>and here is my sample data return</p>
  <pre><code>{
    &quot;total_card2&quot;: 5,
    &quot;total_card: 3,
    &quot;card2&quot;: {
      &quot;98275-JP&quot;: {
        &quot;card_condition&quot;: &quot;NM&quot;,
        &quot;card_price&quot;: &quot;¥ 6,500&quot;,
        &quot;card_qty&quot;: &quot;26&quot;,
        &quot;other_condition&quot;: {}
      },
      &quot;98709-JP&quot;: {
        &quot;card_condition&quot;: &quot;NM&quot;,
        &quot;card_price&quot;: &quot;¥ 6,500&quot;,
        &quot;card_qty&quot;: &quot;1&quot;,
        &quot;other_condition&quot;: {}
      }
    },
    &quot;card&quot;: {
      &quot;LzgZK&quot;: {
        &quot;card_name&quot;: &quot;test2&quot;,
        &quot;price_updated_date&quot;: &quot;2022-01-20T09:05:16.314Z&quot;,
        &quot;set_tag&quot;: &quot;mh2&quot;,
        &quot;rarity&quot;: &quot;rare&quot;,
        &quot;price_normal&quot;: 47.99,
        &quot;price_foil&quot;: 99.99
      },
      &quot;LKGxd&quot;: {
        &quot;card_name&quot;: &quot;test3,
        &quot;price_updated_date&quot;: &quot;2022-01-20T09:05:16.314Z&quot;,
        &quot;set_tag&quot;: &quot;mh2&quot;,
        &quot;rarity&quot;: &quot;rare&quot;,
        &quot;price_normal&quot;: 49.99,
        &quot;price_foil&quot;: 89.99
      },
      &quot;k93K0&quot;: {
        &quot;card_name&quot;: &quot;test4&quot;,
        &quot;price_updated_date&quot;: &quot;2022-01-20T09:05:16.314Z&quot;,
        &quot;set_tag&quot;: &quot;pmh2&quot;,
        &quot;rarity&quot;: &quot;rare&quot;,
        &quot;price_normal&quot;: null,
        &quot;price_foil&quot;: 89.99
      }
    }
  }
  </code></pre>
  <p>here is my sample html output trying to output card only section but not cards2 dict</p>
  <pre><code>{% for cards in card %}
                  &lt;div class=&quot;row gx-4 gx-lg-5 align-items-center&quot;&gt;
                      &lt;div class=&quot;col-md-3&quot;&gt;&lt;img class=&quot;card-img-top mb-5 mb-md-0&quot; src='{{ cards[&quot;card_img_id&quot;] }}' alt=&quot;...&quot; /&gt;&lt;/div&gt;
                      &lt;div class=&quot;col-md-9&quot;&gt;
                          &lt;div class=&quot;small mb-1&quot;&gt;{{ cards.card_name }}&lt;/div&gt;
                          &lt;h1 class=&quot;display-5 fw-bolder&quot;&gt;{{ cards.card_name }}&lt;/h1&gt;
                          &lt;div class=&quot;fs-5 mb-5&quot;&gt;
                              &lt;span class=&quot;text-decoration-line-through&quot;&gt;$45.00&lt;/span&gt;
                              &lt;span&gt;$40.00&lt;/span&gt;
                          &lt;/div&gt;
                          &lt;p class=&quot;lead&quot;&gt;Lorem ipsum dolor sit amet consectetur adipisicing elit. Praesentium at dolorem quidem modi. Nam sequi consequatur obcaecati excepturi alias magni, accusamus eius blanditiis delectus ipsam minima ea iste laborum vero?&lt;/p&gt;
                          &lt;div class=&quot;d-flex&quot;&gt;
                              &lt;input class=&quot;form-control text-center me-3&quot; id=&quot;inputQuantity&quot; type=&quot;num&quot; value=&quot;1&quot; style=&quot;max-width: 3rem&quot; /&gt;
                              &lt;button class=&quot;btn btn-outline-dark flex-shrink-0&quot; type=&quot;button&quot;&gt;
                                  &lt;i class=&quot;bi-cart-fill me-1&quot;&gt;&lt;/i&gt;
                                  Add to cart
                              &lt;/button&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
                   {% endfor %}
  </code></pre>
  <p>i can get 3 results from the loop but outputing from each of the card name and id is not shown out. i am not sure what did i do wrong here this time.</p>