1#In views.py (Python2):
2
3return render_to_response('results.html',
4 {'data': sorted(results_dict.iteritems())})
5#Or in views.py (Python3):
6
7return render_to_response('results.html',
8 {'data': sorted(results_dict.items())})
9#In template file:
10
11{% for key, value in data.items() %}
12 <tr>
13 <td> {{ key }}: </td> <td> {{ value }} </td>
14 </tr>
15{% endfor %}