Skip to main content

Contexts for Django Admin homepage

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_admin_contexts-0.5.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_admin_contexts-0.5.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file django_admin_contexts-0.5.0.tar.gz.

File metadata

  • Download URL: django_admin_contexts-0.5.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_admin_contexts-0.5.0.tar.gz
Algorithm Hash digest
SHA256 16b107b172a62979c5d2483129439798202f0c4d92c6b94fbab5418f6b0c3689
MD5 add597921461d7f295fb5d52cd7c9296
BLAKE2b-256 12cb44cdff804a659b7080b2508e827cf243f12f53bfafd57d3faafb8fa24734

See more details on using hashes here.

File details

Details for the file django_admin_contexts-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_admin_contexts-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b798c355df4fc9184b618eb884bb647ba7ded0db363317e6986cb81d30d7c9e7
MD5 6c582d9c8a9343b5363c4d9f56e4e4d0
BLAKE2b-256 44d8a0178065758a7e7d9330f236e38afd5d995c115ee6a76d1975c0234c71a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page