title: Beginner - using datatables server-side processing with django
body: <p>I'm new to Django &amp; web dev and looking for guidance on getting server-side processing working with my datatable.</p>
  
  <p>Basically, I have an external .db SQLite file with 500k records and I would like to display the records on a bootstrap datatable.</p>
  
  <p>In my views.py file, whenever they visit index.html, I make a query statement to fetch the records (not sure if that's inefficient but it's a small hobby website)</p>
  
  <pre><code>groups = cursor.execute("""SELECT * FROM PlayerGroups""")
  return render(request, 'home/index.html', {'groups': groups}) # the issue since it returns 500k records which is too much for the client to handle.
  </code></pre>
  
  <p>I understand I need to put something like this in "index.html":</p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function(){
          $('#example').dataTable( {
              "bProcessing": true,
              "bServerSide": true,
              "sAjaxSource": &lt;confused about this part...&gt;
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>I'm confused about making my own database API and linking the ajax source to my views/urls file. All of the guides I've looked online show server-side processing with models and stuff. I just have a external .db file I want to show on a datatable.</p>
  
  <p>Any guidance or help would mean a lot.</p>