{% for attribute, plotting in time_series.items %} {% for key, script_and_div in plotting.items %} {{ script_and_div | safe }} {% endfor %} {% endfor %}