Install & Compatibility
Where this runs
tested against v0.1.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
DatatableView
✓ from dj_datatables_view.views import DatatableView
✗ from dj_datatables.views import DatatableView
Basic setup integrating with DataTables server-side processing.
# models.py
from django.db import models
class Person(models.Model):
name = models.CharField(max_length=100)
age = models.IntegerField()
# views.py
from dj_datatables.views import DatatableView
from .models import Person
class PersonListView(DatatableView):
model = Person
columns = ['name', 'age']
# urls.py
from django.urls import path
from .views import PersonListView
urlpatterns = [
path('people/data/', PersonListView.as_view(), name='person_list'),
]
# template.html
<table id="my-table" class="table">
<thead>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
</thead>
</table>
<script>
$(document).ready(function() {
$('#my-table').DataTable({
serverSide: true,
ajax: '{% url "person_list" %}',
columns: [
{ data: 'name' },
{ data: 'age' }
]
});
});
</script>
Upgrade
Version history
0.1.8latest on PyPI · released Feb 24, 2022
Audit
Dependencies
DjangorequiredRequired for the view and ORM integration
django-datatables-viewoptionalThis is a fork of that package, but users should install dj-datatables-view instead