Metadata-Version: 2.4
Name: django-integrations
Version: 2.0.0
Summary: Tools for creating and managing multi-site integrations like API Keys and Tokens.
Author: Roberto Himmelbauer
Author-email: Grant Viklund <renderbox@gmail.com>
Project-URL: Homepage, https://github.com/renderbox/django-integrations
Project-URL: Bug Tracker, https://github.com/renderbox/django-integrations/issues
Keywords: django,app
Classifier: Intended Audience :: Developers
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Framework :: Django :: 6.1
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: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.mit.txt
Requires-Dist: Django<7.0,>=5.2
Requires-Dist: cryptography<46.0.0,>=45.0.2
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: flake8-black; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: django-stubs; extra == "dev"
Requires-Dist: bandit; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: dj-database-url; extra == "dev"
Requires-Dist: django-crispy-forms; extra == "dev"
Requires-Dist: django-allauth; extra == "dev"
Requires-Dist: django-extensions; extra == "dev"
Requires-Dist: psycopg2-binary; extra == "dev"
Provides-Extra: test
Requires-Dist: coverage; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-django>=4.12; extra == "test"
Requires-Dist: dj-database-url; extra == "test"
Requires-Dist: django-crispy-forms>=2.4; extra == "test"
Requires-Dist: django-allauth; extra == "test"
Requires-Dist: django-extensions; extra == "test"
Requires-Dist: psycopg2-binary; extra == "test"
Dynamic: license-file

[![Python Tests](https://github.com/renderbox/django-integrations/actions/workflows/python-test.yml/badge.svg)](https://github.com/renderbox/django-integrations/actions/workflows/python-test.yml)

[![Publish Python 🐍 distribution 📦 to PyPI](https://github.com/renderbox/django-integrations/actions/workflows/python-publish.yml/badge.svg)](https://github.com/renderbox/django-integrations/actions/workflows/python-publish.yml)

# Django Integrations

Tools for defining, storing, validating, and managing multi-site
integrations - API keys, tokens, and their non-secret configuration -
without duplicating each provider's schema across models, forms, an API,
and an admin.

An `Integration` subclass is the single, canonical description of a
provider. Everything else - encrypted secret storage, tenant-scoped
retrieval, a generated edit form, JSON API metadata, secure partial
updates - is derived from it:

```python
from integrations import Integration, register
from integrations.fields import SecretField, TextField

@register
class ZoomIntegration(Integration):
    slug = "zoom"
    name = "Zoom"
    fields = [
        TextField("account_id", label="Account ID", required=True),
        SecretField("api_key", label="API Key", required=True),
    ]
```

No stored secret is ever returned by any interface once saved.

## Installation

```bash
pip install django-integrations
```

```python
INSTALLED_APPS = [
    ...,
    "django.contrib.sites",
    "integrations",
]

SITE_ID = 1
ENCRYPTED_FIELD_KEYS = ["..."]  # see docs/encryption.md - required
```

Full documentation, including the required settings, the JSON API, the
built-in HTML UI, and connection testing, is in [`docs/`](docs/index.md).

## For developers

```bash
pip install -e ".[dev,test]"
pytest --cov=integrations tests
```

`develop/` is a complete, runnable Django project demonstrating the
package (see [`docs/installation.md`](docs/installation.md#try-it) for
how to run it) - its example integrations live in
[`develop/core/integrations.py`](develop/core/integrations.py).

See [`AGENTS.md`](AGENTS.md) and [`plans/`](plans/) for the
architecture and the project's own development plan.
