Display Dictionary Values in Template

How to display following dictionary in template:
inventory = {'1': "{'Name': 'Server1', 'IP': '', 'Version': 'Win'}", '2': "{'Name': 'Server2', 'IP': '', 'Version': 'Linux'}", '3': "{'Name': 'Server3', 'IP': '', 'Version': 'Win'}"}

I want to display in following format in HTML but I cannot figure it out:

Hostname        IP                       Version
Server1         Win
Server2         Linux
Server3         Win

I tried following method:
return render(request, 'inventory.html', inventory)


    {% for i in inventory.values %}
        {% for Name, IP, Version in i.items %}
        <td>{{ Name }}</td>
        <td>{{ IP }}</td>
        <td>{{ Version }}</td>
        {% endfor %}
   {% endfor %}

Side Note: When posting code or templates here, surround the code (or template) between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep the text properly formatted.
(I’ve taken the liberty of fixing your original post for this.)

This is a good start.

Your first iteration through this outer loop will set i to:

Now, this is an issue in that this is a string, and not a dict. Trying to use this in the template is going to be extremely problematic.

So the first thing you’ll want to do is ensure that the values in the inventory dict are also of type dict:

`inventory = {‘1’: {‘Name’: ‘Server1’, ‘IP’: ‘’, ‘Version’: ‘Win’}, ‘2’: {‘Name’: ‘Server2’, ‘IP’: ‘’, ‘Version’: ‘Linux’}, ‘3’: {‘Name’: ‘Server3’, ‘IP’: ‘’, ‘Version’: ‘Win’}}

Now that you’ve got the right types, i would have the value {'Name': 'Server1', 'IP': '', 'Version': 'Win'}

Because this is a dict, you won’t be iterating over it. You’ll access the values as i.Name, etc.

Review the docs at The Django template language | Django documentation | Django for more details.