In my flaskblog.py
file i have following dictionay:
facts = [
{ 'logo': 'img/hex.png',
'exchange':'binance',
'link': 'https://binance.com',
'volume': '345789',
'users24h': '23456'
},
{ 'logo':'img/wolf.png',
'exchange':'kucoin',
'link': 'https://kucoin.com',
'volume':'123458000',
'users24h': '17000'
},
{ 'logo':'img/wolf.png',
'exchange':'hitbtc',
'link': 'https://hitbtc.com',
'volume':'345890',
'users24h': '500'
}
]
in my eth.html
file i have following:
{% extends "layout2.html"%}
{% block content%}
<br>
<br>
<div class="container">
<table id="dtBasicExample" class="table table-striped table-bordered table-sm" cellspacing="0" width="80%">
<thead>
<tr>
<th>Logo</th>
<th>Exchange</th>
<th>Link</th>
<th>volume</th>
<th>Users 24h</th>
<tr>
</thead>
<tbody>
{% for fact in facts %}
<tr>
<td>{{ fact.logo }}</td>
<td>{{ fact.exchange }}</td>
<td>{{ fact.link }}</td>
<td>{{ fact.volume }}</td>
<td>{{ fact.users24h }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock content %}
When i run it it only prints out the table headings like: Logo, exchange, link etc.. but not actually the content of the dictionary
How can I fix this?
I tried
facts
in therender_template
view function as a parameter?