Skip to main content

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
Apps apps screenshot
Both together models and apps screenshot
Graph editor menu screenshot

(Apologies that the images above don't work on PyPI. Check it out on GitHub.)

Installation

Install from PyPI:

pip install django-schema-graph

Add to INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'schema_graph',
    ...
]

Add to your URLs.

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 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.

Release files for django-schema-graph 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-schema-graph 3.1.0
File Size Uploaded
django_schema_graph-3.1.0.tar.gz 323.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-schema-graph 3.1.0
File Interpreter ABI Platform
django_schema_graph-3.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 647.5 kB

Release files / django_schema_graph-3.1.0.tar.gz

Download URL django_schema_graph-3.1.0.tar.gz
Size 323.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d8ef410ccd0db0fce5942a35beaa6badbca76ddce3430d9c58ac1549ad4390ab
BLAKE2b-256 checksum
How to use checksums
b1d507fa056788e1a9dc398e10f389b971b99fa4a653c7780bf83640fceecc30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.11.3 Linux/5.15.0-1037-azure

Release files / django_schema_graph-3.1.0-py3-none-any.whl

Download URL django_schema_graph-3.1.0-py3-none-any.whl
Size 324.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b240e308414018409e1588ca65a0b104f19b3829303e39071e9aa85b86317d3d
BLAKE2b-256 checksum
How to use checksums
e33bdf3825ad4693b69fa7fa95d654e4672992029d5d698813f3e80cc6c38da7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.11.3 Linux/5.15.0-1037-azure

Release history Release notifications | RSS feed

This release

3.1.0 This release

2 release files

3.0.0

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page