Django/DataTables - Template Loop breaks DataTable

Django/DataTables - Template Loop breaks DataTable

When placing a template loop in my table-row my DataTable breaks.

When placing a template loop in my table-row my DataTable breaks.

<table id="store_table" class="table-striped table-hover">
  <thead class="thead-light">
    <tr>
      <th>Store #</th>
      <th>Name</th>
      <th>Phone</th>
      <th>City</th>
      <th>State</th>
    </tr>
  </thead>

&lt;tbody&gt;
{% for store in stores %}
    &lt;tr id="table-row"&gt;
        &lt;td&gt;&lt;a href="/stores/{{ store.pk }}"&gt;{{ store.store_number }}&lt;/a&gt;&lt;/td&gt;
        &lt;td&gt;&lt;a href="/stores/{{ store.pk }}"&gt;{{ store.name }}&lt;/a&gt;&lt;/td&gt;
        &lt;td&gt;{{ store.phone }}&lt;/td&gt;
        &lt;td&gt;{{ store.city }}&lt;/td&gt;
        &lt;td&gt;{{ store.state }}&lt;/td&gt;
        {% for circuit in store.circuit_set.all %}
            &lt;td&gt;{{ circuit.circuit_id }}&lt;/td&gt;
        {% endfor %}
       &lt;td&gt;{{ store.postal }}&lt;/td&gt;

    &lt;/tr&gt;
{% endfor %}
&lt;/tbody&gt;
&lt;/table&gt;

Console Output:

jQuery.Deferred exception: i is undefined [email protected]http://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js:24:397
[email protected]http://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js:16:421
na/<@http://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js:17:21
map/<@https://code.jquery.com/jquery-3.3.1.min.js:2:1324
[email protected]https://code.jquery.com/jquery-3.3.1.min.js:2:3169
[email protected]https://code.jquery.com/jquery-3.3.1.min.js:2:1292
[email protected]http://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js:16:497
[email protected]http://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js:92:431
n/<@http://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js:93:118
[email protected]https://code.jquery.com/jquery-3.3.1.min.js:2:2571
[email protected]https://code.jquery.com/jquery-3.3.1.min.js:2:1238
[email protected]http://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js:83:194
[email protected]http://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js:165:488
@http://10.200.20.63:8080/stores/:12810:19
[email protected]https://code.jquery.com/jquery-3.3.1.min.js:2:29373
a/</c<@https://code.jquery.com/jquery-3.3.1.min.js:2:29677
 undefined

So I'm assuming this is because {% %} isn't a recognized/handleable table element.

django

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Main Pros and Cons of Django As A Web Framework for Python Developers

India's best Institute for Django Online Training Course & Certification. Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Python Django Tutorial | Django Course

🔥Intellipaat Django course: https://intellipaat.com/python-django-training/ 👉This Python Django tutorial will help you learn what is django web development &...

django-allauth Django REST Framework |teratail

Djangoアプリを、当初は Django REST Framework (DRF) を使わずに作成しました。(認証パッケージは、 django-allauthを使用)アプリリリース後に、DRFも追加で導入して、DRFで作成したAPIでのデ

Django REST Framework Course for Beginners

In this article we are going to talk about Django REST Framework Course for Beginners, also for more information you can check the complete video for th

How to Cache Website using Django — Python ?

How to Cache Website using Django — Python ?. In this blog we would discuss caching an entire website(And thus consider it as part 1 of Caching Series).