Posts

Showing posts with the label htmx

Django & HTMX Server-Side Datatables

Image
  In this short guide, you will learn how to create a modern, fast UI for browsing large datasets with Django & HTMX. When dealing with large amounts of data, for example, thousands or millions of rows the DOM will be too slow. In cases like this, it is better to let the database do all the heavy lifting. Prerequisites Basic knowledge of Django Basic knowledge of HTMX LEVEL - 💻 💻 Beginner-Intermediate. Basic knowledge of Django and HTMX is assumed. The codebase for the tutorial can be found  here  . Clone the repository if you want to follow along. Introduction Our objective for this tutorial is to set up a view for browsing a large dataset i.e. 100,000 plus rows. We will be using the  django-tables2  library, to simplify turning tabular data into HTML tables. We will use TailwindCSS to style the table view and HTMX for Ajax requests and DOM manipulation. The Web application We will be building a simple search metrics app that displays a table of search re...