Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/meshy/django-schema-graph
An interactive graph of your Django model structure
https://github.com/meshy/django-schema-graph
database-gui database-schema django django-models django-schema-graph
Last synced: 5 days ago
JSON representation
An interactive graph of your Django model structure
- Host: GitHub
- URL: https://github.com/meshy/django-schema-graph
- Owner: meshy
- License: mit
- Created: 2020-02-16T15:24:33.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-05-14T23:14:07.000Z (over 1 year ago)
- Last Synced: 2025-01-15T00:15:33.296Z (12 days ago)
- Topics: database-gui, database-schema, django, django-models, django-schema-graph
- Language: Python
- Homepage: https://pypi.org/project/django-schema-graph/
- Size: 1.56 MB
- Stars: 375
- Watchers: 9
- Forks: 10
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Django Schema Graph
Django-schema-graph makes a colourful diagram out of your Django models. The
diagram is interactive, and makes it easy to toggle models and apps on/off at
will.It looks like this:
| Feature | Screenshot |
| --- | --- |
| Models | ![models screenshot](docs-images/models.png) |
| Apps | ![apps screenshot](docs-images/apps.png) |
| Both together | ![models and apps screenshot](docs-images/combination.png) |
| Graph editor | ![menu screenshot](docs-images/menu.png) |(Apologies that the images above don't work on PyPI. [Check it out on
GitHub](https://github.com/meshy/django-schema-graph/blob/master/README.md).)## Installation
Install from PyPI:
```bash
pip install django-schema-graph
```Add to `INSTALLED_APPS`:
```python
INSTALLED_APPS = [
...
'schema_graph',
...
]
```Add to your URLs.
```python
from schema_graph.views import Schema
urlpatterns += [
# On Django 2+:
path("schema/", Schema.as_view()),
# Or, on Django < 2:
url(r"^schema/$", Schema.as_view()),
]
```## Use
Browse to `/schema/` (assuming that's where you put it in your URLs).
You can control access to this page using the `SCHEMA_GRAPH_VISIBLE` setting,
or by subclassing `schema_graph.views.Schema` and overriding `access_permitted`.
By default the page is only visible when `DEBUG` is `True`,
because we assume that you don't want to leak sensitive information about your
website outside of local development.## Support
Tests run on sensible combinations of:
- Python (3.10-3.11)
- Django (3.2-4.1)If you're stuck on old version of Python or Django, you may consider installing
old versions.
They will probably have fewer features, and there will be no support for them.The last version to support Python 2.7 and 3.5 was 1.2.0.
The last version to support Python 3.6 to 3.9 was 2.2.1.The last version to support Django 1.8 was 1.2.0.
The last version to support Django 1.9 to 3.1 was 2.2.1.## Alternatives
- [`django-spaghetti-and-meatballs`](https://github.com/LegoStormtroopr/django-spaghetti-and-meatballs)
is great. At the time of writing, it offers a lot more detailed information
on the models in the diagram, but doesn't allow them to be turned on/off in
the page.