How to access(loop through) queryset passed from views to html template inside javascript block in django?

Viewed 13

I want to loop through array/queryset passed from view to html template in django inside

{% block js %}

block, is it possible ?

{% block js %}
I want to access array/queryset/value passed from views here
{% endblock %}
1 Answers

Yeah, You can do it Like this,

{% for item in array %}
    {‌{ item }}
    <br>
{% endfor %}
Related