Control the sort order of apps and models in the Django admin interface.
This is an independent, unofficial third-party package. It is not affiliated with or endorsed by the Django Software Foundation.
pip install django-admin-sortkeyAdd to INSTALLED_APPS before django.contrib.admin:
INSTALLED_APPS = [
"django_admin_sortkey",
"django.contrib.admin",
...
]# myapp/apps.py
from django.apps import AppConfig
class MyAppConfig(AppConfig):
name = "myapp"
app_sort = 10 # lower appears first; omit to sort alphabetically after explicit ones# myapp/admin.py
from django.contrib import admin
from .models import Invoice
@admin.register(Invoice)
class InvoiceAdmin(admin.ModelAdmin):
model_sort = 1 # lower appears first within the app sectionApps and models without an explicit sort value fall back to alphabetical ordering and appear after all explicitly sorted ones.
Patches AdminSite.get_app_list() once at app startup (AppConfig.ready()).
No Django source modifications. Zero rebase maintenance.
pip install -e ".[dev]"
pytestBSD-3-Clause, matching Django's own license.