Display only a set of apps and models in the Django Admin homepage, based on the chosen context. This is useful when you have a lot of apps and models and you want to focus on a specific set of them.
Via pip command:
pip install django-admin-contexts...or you can clone the repo and install it using pip too:
git clone git://github.com/matagus/django-admin-contexts.git
cd django-admin-contexts
pip install -e .then add django_admin_contexts to your settings.py before django.contrib.admin:
INSTALLED_APPS = (
# ...
"django_admin_contexts",
# ...
"django.contrib.admin",
# ...
)then run the migrations:
python manage.py migrateBrowse to the Django Admin and create some contexts in the "Django Admin Contexts" section, associating them with one or more models.
Then, you can see the contexts in the Django Admin homepage.
Prerequisites: Install Hatch if not already installed: pip install hatch
List available test environments:
hatch env show testRun all tests (all Python + Django combinations):
hatch run test:testRun tests for specific Python/Django version:
hatch run test.py3.14-5.2:test # Python 3.14 + Django 5.2
hatch run test.py3.12-5.1:test # Python 3.12 + Django 5.1Run specific test file:
hatch run test.py3.14-5.2:test tests.test_modelsCoverage:
hatch run test:cov # Run tests with coverage reportTroubleshooting: If you encounter environment issues, clean and rebuild: hatch env prune
Contributions are welcome! โค๏ธ
Please read Contributing.md for detailed instructions on how to help.
django-admin-contexts is released under a BSD License
