Control the sort order of apps and models in the Django admin interface.
Project description
django-admin-app-model-sort
Control the sort order of apps and models in the Django admin index page.
This is an independent, unofficial third-party package. It is not affiliated with or endorsed by the Django Software Foundation.
Install
pip install django-admin-app-model-sort
Add to INSTALLED_APPS before django.contrib.admin:
INSTALLED_APPS = [
"django_admin_app_model_sort",
"django.contrib.admin",
...
]
Usage
Sort apps in the admin index
# 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
Sort models within an app
# 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 section
Apps and models without an explicit sort value fall back to alphabetical ordering and appear after all explicitly sorted ones.
How it works
Patches AdminSite.get_app_list() once at app startup (AppConfig.ready()).
No Django source modifications. Zero rebase maintenance.
Running tests
pip install -e ".[dev]"
pytest
License
BSD-3-Clause.
Contribution
Issues and pull requests are welcome.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_admin_app_model_sort-0.1.0.tar.gz.
File metadata
- Download URL: django_admin_app_model_sort-0.1.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5305556435bdaf9b2c36a401ffbb23568de2612f66fd82bdd8d5e517c9d0dbb
|
|
| MD5 |
fbd3780672c9b08c4ec7172ab353cbb0
|
|
| BLAKE2b-256 |
e686590340f74596dea8b3b22ea978345455cb57e1a55452a3b81e958a577efc
|
Provenance
The following attestation bundles were made for django_admin_app_model_sort-0.1.0.tar.gz:
Publisher:
publish.yml on omidshojaee/django-admin-app-model-sort
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_admin_app_model_sort-0.1.0.tar.gz -
Subject digest:
c5305556435bdaf9b2c36a401ffbb23568de2612f66fd82bdd8d5e517c9d0dbb - Sigstore transparency entry: 2116389597
- Sigstore integration time:
-
Permalink:
omidshojaee/django-admin-app-model-sort@4b6ed49a9a06d5c4b5aa263264c8e66ab4850746 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/omidshojaee
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4b6ed49a9a06d5c4b5aa263264c8e66ab4850746 -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_admin_app_model_sort-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_admin_app_model_sort-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b58851813f653c77e6ed1c28fcad05a2e3ba704b71f3ce2f37ccfb4e05dcc6df
|
|
| MD5 |
60f12dc087a21426c07614b72690cf4f
|
|
| BLAKE2b-256 |
853b105c3a8f64e8e8caaac59965aaccc6581d51db1e8a53055cd3c1c4912c93
|
Provenance
The following attestation bundles were made for django_admin_app_model_sort-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on omidshojaee/django-admin-app-model-sort
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_admin_app_model_sort-0.1.0-py3-none-any.whl -
Subject digest:
b58851813f653c77e6ed1c28fcad05a2e3ba704b71f3ce2f37ccfb4e05dcc6df - Sigstore transparency entry: 2116389781
- Sigstore integration time:
-
Permalink:
omidshojaee/django-admin-app-model-sort@4b6ed49a9a06d5c4b5aa263264c8e66ab4850746 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/omidshojaee
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4b6ed49a9a06d5c4b5aa263264c8e66ab4850746 -
Trigger Event:
push
-
Statement type: