Metadata-Version: 2.4
Name: django-admin-contexts
Version: 0.5.0
Summary: Contexts for Django Admin homepage
Project-URL: Homepage, https://matagus.github.io/django-admin-contexts/
Project-URL: Issues, https://github.com/matagus/django-admin-contexts/issues
Project-URL: Discussions, https://github.com/matagus/django-admin-contexts/discussions
Project-URL: Repository, https://github.com/matagus/django-admin-contexts
Project-URL: Changelog, https://github.com/matagus/django-admin-contexts/releases
Project-URL: Pypi, https://pypi.org/project/django-admin-contexts
Author-email: Matias Agustin Mendez <matagus@gmail.com>
License-Expression: BSD-3-Clause
License-File: AUTHORS.md
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Requires-Dist: django>=4.2
Provides-Extra: dev
Requires-Dist: django-debug-toolbar; extra == 'dev'
Requires-Dist: django-extensions; extra == 'dev'
Requires-Dist: ipython; extra == 'dev'
Requires-Dist: werkzeug; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs; extra == 'docs'
Requires-Dist: mkdocs-material; extra == 'docs'
Requires-Dist: pygments; extra == 'docs'
Requires-Dist: pymdown-extensions; extra == 'docs'
Description-Content-Type: text/markdown

# django-admin-contexts

![Python Compatibility](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue.svg)
![Django Compatibility](https://img.shields.io/badge/django-4.2%20|%205.0%20|%205.1%20|%205.2%20|%206.0-%2344B78B?labelColor=%23092E20)
[![PyPi Version](https://img.shields.io/pypi/v/django-admin-contexts.svg)](https://pypi.python.org/pypi/django-admin-contexts)
![CI badge](https://github.com/matagus/django-admin-contexts/actions/workflows/ci.yml/badge.svg)
[![codecov](https://codecov.io/gh/matagus/django-admin-contexts/graph/badge.svg?token=a64SxEDQk0)](https://codecov.io/gh/matagus/django-admin-contexts)
[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)

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](https://raw.githubusercontent.com/matagus/django-admin-contexts/main/screenshots/demo.gif)


Installation
============

Via `pip` command:

```bash
pip install django-admin-contexts
```

...or you can clone the repo and install it using `pip` too:

```bash
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`:

```python
INSTALLED_APPS = (
    # ...
    "django_admin_contexts",
    # ...
    "django.contrib.admin",
    # ...
)
```

then run the migrations:

```bash
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:**
```bash
hatch env show test
```

**Run all tests (all Python + Django combinations):**
```bash
hatch run test:test
```

**Run tests for specific Python/Django version:**
```bash
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:**
```bash
hatch run test.py3.14-6.0:test tests.test_models
```

**Coverage:**
```bash
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](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](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch) [![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![code style - black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
