Metadata-Version: 2.4
Name: django-admin-grove
Version: 0.1.0
Summary: A forest-green theme for Django admin, with light, dark, and print styles.
Author: Fabian Braun
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: Django<6.1,>=5.2

# Django Admin Grove

A forest-green theme for Django admin with rounded surfaces, light and dark modes,
responsive layouts, and a print stylesheet. No JavaScript, external fonts, models,
or migrations are required. Uses Django's existing theme toggle and branding.

## Installation

Install directly from Codeberg:

```sh
python -m pip install git+https://codeberg.org/fsbraun/django-admin-grove
```

Add Grove **before** Django's admin app (including custom AdminConfig subclasses):

```python
INSTALLED_APPS = [
    "django_admin_grove",
    "django.contrib.admin",
    # ...
]
```

Use Django's app template loader (`APP_DIRS = True`, or the explicit
`django.template.loaders.app_directories.Loader`) and staticfiles as usual.
Run `python manage.py collectstatic` for production deployments.
No URL configuration or database changes are needed. Django CMS is optional.

Supports Django 5.2 and 6.0; use a Python version supported by your Django release.

## Customization

Set `admin.site.site_header`, `site_title`, and `index_title` normally, or override
`admin/base_site.html` in your project. Grove leaves Django's branding blocks intact.
Project templates should extend `admin/base.html` and keep `block.super` when
replacing the `responsive` block.

Load project CSS after Grove using its `grove_styles` block:

```django
{% extends "admin/base.html" %}
{% load static %}
{% block grove_styles %}
<link rel="stylesheet" href="{% static 'myproject/admin.css' %}">
{% endblock %}
```

Override the `--theme-*` CSS variables for colors and surfaces. Match Grove's
`html[data-theme="light"]` and `html[data-theme="dark"]` selectors when customizing
both modes. System preferences apply when Django selects automatic mode.
The `--dca-primary` and `--dca-secondary` variables follow the active palette.

Printing uses A4 landscape and hides admin controls. Use `.report-screen-only`
to hide custom controls in print and `.report-print-only` for print-only context.
Domain-specific selectors and branding belong in the consuming project.

## Development

```sh
python -m pip install -e .
python -m django test tests --settings=tests.settings
python -m pip install build
python -m build
```

Tests run against plain Django admin with an in-memory database.

## Publishing

Enable Actions in the Codeberg repository settings and make a runner with the
`codeberg-local` label available. Add a PyPI API token as the Actions secret
`PYPI_API_TOKEN`.

Update the version in `pyproject.toml`, then publish a Codeberg release with a
matching tag (for example, `0.1.0` or `v0.1.0`). The publication workflow checks
the version, runs the tests, builds and validates the wheel and source
distribution, and uploads both to PyPI.
