John Smith John Smith - 9 months ago 30
Python Question

How do I parse this data in a Django template?

{u'4th-of-July': {'name': 4th of July', 'slug': u'4th-of-July'}}

I would like to have access to
in a django HTML template. How do I go about doing this?


You can access a dict in template with dot notation:

Let's call your dictionary data:

{{ }}


{{ data.4th-of-July.slug }}