I\'m trying to learning django templates but it\'s not easy. I have a certain views.py containing a dictionary to be rendered with a template. The dictionary is made of ke
Although changing the code in the view is preferable, you could also use the dictsort template tag:
https://docs.djangoproject.com/en/stable/ref/templates/builtins/#std:templatefilter-dictsort
{% for key, value in data.items|dictsort:"0.lower" %} {{ key }}: {{ value }}