I am trying to print comma separated key values after drilling into a dictionary. But I am unable to get rid of dict_keys()
that shows in my output.
Here is my template:
metrics.html
<h1>Accessing values</h1>
<p>{{ final_metrics.values }} </p>
<p>{{final_metrics.data.0.13.browser.Chrome}}</p>
<h1>{{ final_metrics.month }} Clicks Statistics</h1>
<p>Short Url: {{final_metrics.short_url }}</p>
<p>Date Accessed: {{ final_metrics.data.0.keys }}</p>
<p>Browser: {{final_metrics.data.0.13.browser.keys}}</p>
<p>Platform: {{final_metrics.data.0.13.platform.keys}}</p>
and on the output screen it shows as follows
Is there a way to get rid of the dict_keys()
and have those values in a comma separated format?
I have tried the solutions from https://stackoverflow.com/a/8000091 and https://stackoverflow.com/a/34542858 but does not seem to work for me.