title: how to set DTL(Django Tamplate language) for loop and value through javascript
body: <p>I want to set django for loop to set value through javascript like this. is this correct way? or Is there any other way?</p>
  <pre><code>    var table = $('.checkbox-datatable').DataTable({
          'scrollCollapse': true,
          'autoWidth': false,
          'responsive': true,
          &quot;lengthMenu&quot;: [[10, 25, 50, -1], [10, 25, 50, &quot;All&quot;]],
          &quot;language&quot;: {
              &quot;info&quot;: &quot;_START_-_END of TOTAL_ entries&quot;,
              searchPlaceholder: &quot;Search&quot;,
              paginate: {
                  next: '&lt;i class=&quot;ion-chevron-right&quot;&gt;&lt;/i&gt;',
                  previous: '&lt;i class=&quot;ion-chevron-left&quot;&gt;&lt;/i&gt;'  
              }
          },
          'columnDefs': [{
              'targets': 0,
              'searchable': false,
              'orderable': false,
              'className': 'dt-body-center',
              'render': function (data, type, full, meta){
                  return '&lt;div class=&quot;dt-checkbox&quot;&gt;&lt;input type=&quot;checkbox&quot; name=
  
  &quot;id[]&quot; id=&quot;chkuser&quot;  value=&quot;' +  {% for dd in departmentData %}{{dd.id}}{% endfor %} + '&quot; /&gt;&lt;span class=&quot;dt-checkbox-label&quot;&gt;&lt;/span&gt;&lt;/div&gt;';
          }
      }],
      'order': [[1, 'asc']]
  });
  </code></pre>