Django Admin Sorting Module


Official Documentation: https://django-admin-sortable2.readthedocs.io/en/latest/installation.html

 

During this post we will learn how to easily sort model instances through the Django admin dashboard




To test quickly: clone mysite, a basic Django project in my GitHub(38130):

git clone https://github.com/38130/mysite


 

pip install django-admin-sortable2

 

INSTALLED_APPS = [
    ...
    'adminsortable2',
]

 

from django.db import models


class SortableBook(models.Model):
    title = models.CharField(
        "Title",
        max_length=255,
    )

    my_order = models.PositiveIntegerField(
        default=0,
        blank=False,
        null=False,
    )

    class Meta:
        ordering = ['my_order']

 

from django.contrib import admin
from .models import SortableBook


from adminsortable2.admin import SortableAdminMixin


@admin.register(SortableBook)
class SortableBookAdmin(SortableAdminMixin, admin.ModelAdmin):
    pass

 


Add some instances to your model and should be working right away!

 

 


Tested with:
Django==5.2
django-admin-sortable2==2.2.8


12 Dec. 2025 | Last Updated: 12 Dec. 2025 | jaimedcsilva

Related
  • Exclusion Query
  • Inserting specific dates in Database
  • Find duplicated database entries
  • Create models for the same app in different files
  • Database Performance Check - Django
  • Django Admin Sorting Module

  • Buy Me a Coffee