Metadata-Version: 2.4
Name: lxcor-docca
Version: 0.1.2
Summary: API documentation portal for Django REST Framework — auto-syncs endpoints, renders a searchable portal with tags, parameters, and response fields.
Author-email: Alexandre Scozzafave Alves <frontdesk@lxcor.com>
License: MIT
Project-URL: Homepage, https://github.com/lxcor/api-suite/tree/main/docca
Project-URL: Repository, https://github.com/lxcor/api-suite
Keywords: django,drf,api,documentation,portal
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Django
Classifier: Framework :: Django :: 3.2
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: django>=3.2
Requires-Dist: djangorestframework>=3.14
Dynamic: license-file

# docca

API documentation portal for Django REST Framework.

`docca` auto-discovers your DRF viewsets and API views, syncs them into a database-backed manifest, and renders a searchable portal with tags, parameters, and response fields — no YAML, no decorators, no separate spec file.

Part of the [lxcor/api-suite](https://github.com/lxcor/api-suite).

## Install

```bash
pip install lxcor-docca
```

## Setup

```python
# settings.py
INSTALLED_APPS = [
    ...
    'docca',
]
```

```python
# urls.py
from django.urls import path, include

urlpatterns = [
    path('docs/', include('docca.urls')),
]
```

Annotate your views:

```python
class MySunriseViewSet(viewsets.ViewSet):
    docca_tag = 'Solar'
    docca_overview = 'Returns sunrise and sunset times for a given location and date.'
```

Sync endpoints into the database:

```bash
python manage.py syncdocs
```

Visit `/docs/` to see the portal.

## Settings

| Setting | Default | Description |
|---|---|---|
| `DOCCA_APP_COLORS` | `{}` | Bootstrap color per app label (`'warning'`, `'danger'`, etc.) |
| `DOCCA_APP_DESCRIPTIONS` | `{}` | Product-facing description per app, shown on the portal |

## Management commands

| Command | Description |
|---|---|
| `syncdocs` | Discover and sync all DRF endpoints into the database |

> **Warning — `syncdocs` is authoritative for `summary` and `description`.**
> Every run re-reads the view docstrings and overwrites those two fields in the database.
> Edits made directly to the DB or to fixture files will be lost on the next `syncdocs` run.
> To set a permanent custom summary, update the view or method docstring instead.

## License

MIT
