Skip to main content

Visualize Django models as an interactive ERD diagram in the browser

Project description

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

pip install django-lumen

Setup

  1. Add django_lumen to INSTALLED_APPS:
# settings.py
INSTALLED_APPS = [
    ...
    "django_lumen",
]
  1. Mount the URLs in your root urls.py:
# urls.py
from django.urls import path, include

urlpatterns = [
    ...
    path("lumen/", include("django_lumen.urls")),
]
  1. Run migrations:
python manage.py migrate
  1. Start the development server and open 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.

App filter

The sidebar lists every app present in the diagram. Clicking an app name filters the diagram to show only models belonging to that app plus any models they have direct relations to. Click again to deselect. Multiple apps can be selected at once — when no app is selected, all models are shown.

Right-clicking an app name marks it as excluded (shown in red with strikethrough). Excluded apps are completely hidden from the diagram and the preference is saved automatically. Right-click again to un-exclude.

Settings

Each staff user has their own saved preferences, accessible via the Settings link in the diagram header. The settings page provides three sections:

Managed tables — when enabled, models with managed = False in their Meta class are hidden from the diagram.

Show inheritance — when enabled, each model box displays its parent class(es) below the model name. The default Django base (models.Model) is not shown — only custom application-level parents are displayed.

Excluded models — a list of regex patterns matched against model names. Any model whose name matches at least one pattern is hidden. Patterns use Python re.search, so use ^/$ to anchor. Examples: ^Historical, Log$, Audit.

Excluded apps — checkboxes to permanently hide entire apps from the diagram. The following apps are hidden by default: auth, admin, sessions, contenttypes, django_lumen. Users can also right-click an app chip in the sidebar to exclude it directly from the diagram view.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_lumen-0.2.3.tar.gz (61.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_lumen-0.2.3-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file django_lumen-0.2.3.tar.gz.

File metadata

  • Download URL: django_lumen-0.2.3.tar.gz
  • Upload date:
  • Size: 61.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.3 HTTPX/0.28.1

File hashes

Hashes for django_lumen-0.2.3.tar.gz
Algorithm Hash digest
SHA256 8dbd4849fead95ebbf49867b89b818b7caba71daab26ed5c4e69432bdad62489
MD5 3217060bdee05f669870d753d54bd0e2
BLAKE2b-256 a5319f0c31a3b56f7563562ca6cd8b96ef464aa5d4c523e3ca66172c963dda0a

See more details on using hashes here.

File details

Details for the file django_lumen-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: django_lumen-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.3 HTTPX/0.28.1

File hashes

Hashes for django_lumen-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 76dc8b7f961ebc91f5c1a76e1d13d6e397a3fbb856d09536e9cb11b2cc1ecf5b
MD5 333c0515339d52c9b23c93f70ada5b29
BLAKE2b-256 67aaabfa0a97882782c752fef379fc02fd2b06d7d2b5a76c150304ead9fb527f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page