[Django]-How to obtain dicts key and values in Django template?

4๐Ÿ‘

โœ…

<table align="center" cellpadding="4px">
    <tr>
    {% for key, value in index_display.items %}
        {% if value == None %}
            <td><a href="">{{ key }}</a></td>
            <td id="partners_nav_bracket">|</td>
        {% else %}
            <td><a href="{{ value }}">{{ key }}</a></td>
            <td id="partners_nav_bracket">|</td>
        {% endif %}
    {% endfor %}
    </tr>
</table>
๐Ÿ‘คN. L. Long

Leave a comment