I did this in a project that I worked on a while ago. This is how I defined the table in my template:
$(document).ready( function () { var ticketTable = $('#ticket-table').dataTable( { "fnDrawCallback": function() { // Initialize popovers anytime new data is loaded into the table $('a[rel=tooltip]').tooltip({ placement: 'left' }); }, "bServerSide": true, "bAutoWidth": false, "sPaginationType": "bootstrap", "sAjaxSource": "{% url get_tickets_list %}", "aaSorting": [[ 2, "desc" ]], "iPageLength": 25, "bLengthChange": false, "bStateSave": true, "bFilter": true, "sDom": "<'length-change'><'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'length-change'><'span6'p>>", "oLanguage": { "sSearch": "" }, "aoColumns": [ { "bSortable": false, "sWidth": "14px", "bSearchable": false }, { "sWidth": "160px", "bSearchable": true }, { "sWidth": "60px", "bSearchable": true }, { "bSearchable": true }, { "bSortable": false, "sWidth": "14px", "bSearchable": false }, { "sWidth": "50px", "sClass": "center", "bSearchable": false }, { "bSearchable": true }, { "sWidth": "70px", "sClass": "center", "bSearchable": false }, { "sWidth": "75px", "bSearchable": true } ] } ).fnSetFilteringDelay(500);
The key is the line in the table parameters that defines the source URL for the AJAX request from the DataTable:
"sAjaxSource": "{% url get_tickets_list %}",
Then you also need a view to return AJAX requests:
def get_tickets_list(request, queryset=Ticket.objects.all()): """ AJAX calls for DataTable ticket list. """
As I said, it was a long time ago and may no longer work with the latest versions of DataTable, but it may set you in the right direction.