Skip to main content

django-admin-contexts

Python Compatibility Django Compatibility PyPi Version CI badge codecov License

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.

Demo: selecting a context to display only a subset of models

Installation

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 migrate

Usage

Browse 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.

Running Tests

Prerequisites: Install Hatch if not already installed: pip install hatch

List available test environments:

hatch env show test

Run all tests (all Python + Django combinations):

hatch run test:test

Run tests for specific Python/Django version:

hatch run test.py3.14-6.0:test  # Python 3.14 + Django 6.0
hatch run test.py3.12-5.1:test  # Python 3.12 + Django 5.1

Run specific test file:

hatch run test.py3.14-6.0:test tests.test_models

Coverage:

hatch run test:cov  # Run tests with coverage report

Troubleshooting: If you encounter environment issues, clean and rebuild: hatch env prune

Contributing

Contributions are welcome! ❤️

Please read Contributing.md for detailed instructions on how to help.

License

django-admin-contexts is released under a BSD License

Acknowledgements

Develop & built using Hatch project linting - Ruff code style - black

Metadata

Release files for django-admin-contexts 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-admin-contexts 0.5.0
File Size Uploaded
django_admin_contexts-0.5.0.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-admin-contexts 0.5.0
File Interpreter ABI Platform
django_admin_contexts-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / django_admin_contexts-0.5.0.tar.gz

Download URL django_admin_contexts-0.5.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
16b107b172a62979c5d2483129439798202f0c4d92c6b94fbab5418f6b0c3689
BLAKE2b-256 checksum
How to use checksums
12cb44cdff804a659b7080b2508e827cf243f12f53bfafd57d3faafb8fa24734
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / django_admin_contexts-0.5.0-py3-none-any.whl

Download URL django_admin_contexts-0.5.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b798c355df4fc9184b618eb884bb647ba7ded0db363317e6986cb81d30d7c9e7
BLAKE2b-256 checksum
How to use checksums
44d8a0178065758a7e7d9330f236e38afd5d995c115ee6a76d1975c0234c71a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page