# django-lumen

Visualize your Django models as an interactive ERD diagram in the browser. No external diagram library — the diagram is pure vanilla JS + SVG rendered at request time from the live Django model registry.

## Requirements

- Python 3.10+
- Django 3.2+

## Installation

```bash
pip install django-lumen
```

## Setup

1. Add `django_lumen` to `INSTALLED_APPS`:

```python
# settings.py
INSTALLED_APPS = [
    ...
    "django_lumen",
]
```

2. Mount the URLs in your root `urls.py`:

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

urlpatterns = [
    ...
    path("lumen/", include("django_lumen.urls")),
]
```

3. Run migrations:

```bash
python manage.py migrate
```

4. Start the development server and open [http://localhost:8000/lumen/](http://localhost:8000/lumen/).

## Access control

The diagram is only accessible to users with `is_active = True` **and** `is_staff = True`. Other users are redirected to the login page.

## Default excluded apps

The following apps are hidden by default: `auth`, `admin`, `sessions`, `contenttypes`, `django_lumen`. Users can change this via the **Manage excluded apps** settings page or by right-clicking an app chip in the sidebar.
