--- id: django-tables2 version: "3.0.0" license: All changes made to django-tables2 since forking from django-tables are Copyright (c) 2011, Bradley Ayers All rights reserved. Redistribution is permitted under the same… (full text in the JSON record) license_treatment: permissive maintenance: active --- # django-tables2 — Table/data-grid framework for Django License: permissive · Maintenance: active · Downloads: 1.0M/mo ## What it is and what it does django-tables2 is a Django app that converts querysets and other iterables into rendered HTML tables with minimal boilerplate. It works by defining a Table subclass that declares columns and metadata, then passing that table class to a view mixin or template tag. The package handles pagination, column sorting, and template rendering without requiring JavaScript, and supports automatic table generation from Django models. The package is designed for developers who need to display tabular data in Django templates. It reduces repetitive HTML generation and provides a declarative, model-like syntax familiar to Django users. It works with any iterable data source but has special integration with Django querysets, making it particularly useful for displaying database results with sorting and pagination controls. Use it for: - Display a Django model's records in a paginated, sortable HTML table in an admin-like interface - Generate data grids from filtered querysets with automatic column rendering and pagination - Build custom table layouts by subclassing Table and defining column types and behaviors - Render querysets in templates without writing raw HTML loops or manual pagination logic - Create sortable, paginated reports from any iterable data source in a Django view ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. django-tables2 generates HTML tables from Django querysets and other iterables, with built-in pagination and column sorting, similar to how django.forms handles form generation. Yes. django-tables2 is actively maintained, has no known vulnerabilities, carries a permissive BSD license, and solves a common Django problem with low install friction. It is well-suited for any Django project that needs to display tabular data with pagination and sorting. ## Install pip install django-tables2 uv add django-tables2 poetry add django-tables2 ## Installing django-tables2 Before you install: Low install friction with a single runtime dependency (django). Active maintenance with a recent release (123 days ago) and ongoing repository activity. License in practice: BSD license (permissive). You may use, modify, and distribute the package freely in commercial and private projects, provided you retain the license notice. Quickstart: # Install pip install django-tables2 # In settings.py INSTALLED_APPS = (..., "django_tables2") # Define a table import django_tables2 as tables class MyTable(tables.Table): class Meta: model = MyModel # In a view class MyTableView(tables.SingleTableView): table_class = MyTable queryset = MyModel.objects.all() # In template {% load django_tables2 %} {% render_table table %} Requires Django and Python 3.10 or later; the package must be added to INSTALLED_APPS for template tags to work. Verify before relying: - Whether the package supports Django 5.2 and 6.0 in practice or only declares compatibility - Performance characteristics with large querysets or complex custom columns ## Package facts - License: All changes made to django-tables2 since forking from django-tables are Copyright (c) 2011, Bradley Ayers All rights reserved. Redistribution is permitted under the same… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags django table generation, html table from queryset, django pagination sorting, data grid for django, django table rendering, querysets to html tables, django table framework, django-tables, html-generation [View on SkillFed](https://skillfed.io/packages/django-tables2) · [View on PyPI](https://pypi.org/project/django-tables2/)