Metadata-Version: 2.4
Name: django-conjure
Version: 0.1.1
Summary: Conjure your Django admin — read your models, summon a CRUD API and dashboard.
Project-URL: Homepage, https://conjure.terracelab.co.kr
Project-URL: Documentation, https://docs.conjure.terracelab.co.kr
Project-URL: Repository, https://github.com/terracelab/django-conjure
Project-URL: Changelog, https://github.com/terracelab/django-conjure/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/terracelab/django-conjure/issues
Author-email: Terrace Lab <hello@terracelab.co.kr>
License-Expression: MIT
License-File: LICENSE
Keywords: admin,codegen,crud,dashboard,django,introspection,rest
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3 :: Only
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: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.10
Requires-Dist: django>=4.2
Requires-Dist: djangorestframework>=3.15
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: django>=4.2; extra == 'dev'
Requires-Dist: djangorestframework-simplejwt>=5.3; extra == 'dev'
Requires-Dist: djangorestframework>=3.15; extra == 'dev'
Requires-Dist: pytest-django>=4.8; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Provides-Extra: jwt
Requires-Dist: djangorestframework-simplejwt>=5.3; extra == 'jwt'
Description-Content-Type: text/markdown

# django-conjure

> Conjure your Django admin — read your models, summon a CRUD API + schema.

The Python package behind [Conjure](https://conjure.terracelab.co.kr). It introspects your
models and serves a generic admin **REST API** (`/conjure/`) plus a schema endpoint that a
frontend — or codegen — can read. A matching React dashboard lives in the repo and is in
active development; for the `0.1.x` line, point any client at the API below.

## Install

```bash
pip install django-conjure          # session auth (default)
pip install "django-conjure[jwt]"   # add JWT auth mode
```

```python
# settings.py
INSTALLED_APPS += ["conjure"]

CONJURE = {
    "AUTH": "session",                       # or "jwt"
    "BRAND": {"name": "My Admin", "accent": "#4f46e5"},
    # "USER_PAYLOAD": "myapp.hooks.payload", # custom user model? return any dict
}
```

```python
# urls.py
urlpatterns += [path("conjure/", include("conjure.urls"))]
```

```bash
python manage.py migrate conjure   # AdminAuditLog table (audit log, optional but recommended)
```

## Register a model

Drop an `admin_config.py` into any app — it's discovered automatically, like `admin.py`:

```python
from conjure import register, AdminConfig
from myapp.models import Product

@register(Product)
class ProductConfig(AdminConfig):
    list_display = ["name", "price", "is_active"]
    search_fields = ["name"]
    list_filter = ["is_active"]
    inlines = [(ProductImage, "product")]   # inline child editing
    is_readonly = False                     # True => log/history models, blocks writes
```

Anything you leave unset is inferred from the model's fields.

## What you get

- `GET /conjure/schema/` + `…/schema/{app.Model}/` — model introspection (codegen + runtime source)
- `GET/POST /conjure/r/{app.Model}/` and `…/{pk}/` — generic CRUD
- `…/autocomplete/`, `…/bulk/` (atomic inline ops), `…/{pk}/related/` (delete impact)
- Django-permission gating (`view/add/change/delete`, shared with Django admin), `is_staff` required
- Audit log with before/after diff, staff auth (session or JWT), dashboard widget registry

## Extend without forking

```python
from conjure import register_widget

@register_widget("signup-trend")
def signup_trend(request):
    ...  # return any JSON; served at /conjure/widgets/signup-trend/
```

Full docs, the settings reference, the REST contract, and the extension SDK live at
**[docs.conjure.terracelab.co.kr](https://docs.conjure.terracelab.co.kr)**.

## Develop

```bash
pip install -e ".[dev]"
pytest
ruff check . && ruff format --check .
```

MIT © Terrace Lab
