Metadata-Version: 2.1
Name: django-schema-viewer
Version: 0.3.0
Project-URL: Documentation, https://github.com/pikhovkin/django-schema-viewer#readme
Project-URL: Issues, https://github.com/pikhovkin/django-schema-viewer/issues
Project-URL: Source, https://github.com/pikhovkin/django-schema-viewer
Author-email: Sergei Pikhovkin <s@pikhovkin.ru>
License-Expression: MIT
License-File: LICENSE
Keywords: database-gui,database-schema,django,django-models,entity-relationship-diagram,er-diagram,erd,json-table-schema,schema,schema-diagram,schema-graph,schema-viewer,viewer
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django :: 4.0
Classifier: Framework :: Django :: 4.1
Classifier: Framework :: Django :: 4.2
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
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: Topic :: System :: Monitoring
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Requires-Dist: django<4.3,>=4.0
Description-Content-Type: text/markdown

# django-schema-viewer

[![GitHub Actions](https://github.com/pikhovkin/django-schema-viewer/workflows/build/badge.svg)](https://github.com/pikhovkin/django-schema-viewer/actions)
[![PyPI - Version](https://img.shields.io/pypi/v/django-schema-viewer.svg)](https://pypi.org/project/django-schema-viewer)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-schema-viewer.svg)](https://pypi.org/project/django-schema-viewer)
[![PyPI - Django Version](https://img.shields.io/pypi/djversions/django-schema-viewer.svg)](https://pypi.org/project/django-schema-viewer)
[![PyPI - License](https://img.shields.io/pypi/l/django-schema-viewer.svg)](./LICENSE)

[![framework - Django](https://img.shields.io/badge/framework-Django-0C3C26.svg)](https://www.djangoproject.com/)
[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

Visualizes the DB schema based on Django models.

[![django-schema-viewer screen](docs/screenview.png "Click to see demo")](https://django-schema-viewer.up.railway.app/schema-viewer/)

### Installation

```console
pip install django-schema-viewer
```

### Usage

1. Install the package

2. Add `schema_viewer` to your `INSTALLED_APPS` settings like this:

```python
INSTALLED_APPS = [
    ...,
    'schema_viewer',
    ...,
]
```

3. Add `schema_viewer.urls` to main `urls.py`:

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

urlpatterns = [
    ...,
    path('schema-viewer', include('schema_viewer.urls')),
    ...,
]
```

4. Run the project

```console
python manange.py runserver
```

5. Go to http://127.0.0.1:8000/schema-viewer/

### Optional settings

```python
SCHEMA_VIEWER = {
    'apps': [
        'contenttypes',
        'my_app',
    ],
    'exclude': {
        'auth': ['User'],
        'my_app': ['SomeModel'],
    },
}
```

## License

MIT
