Visualizes a DB schema based on Django models.
pip install django-schema-viewer
-
Install the package
-
Add
schema_viewer
to yourINSTALLED_APPS
settings like this:
INSTALLED_APPS = [
...,
'schema_viewer',
...,
]
- Add
schema_viewer.urls
to mainurls.py
:
from django.urls import path, include
urlpatterns = [
...,
path('schema-viewer/', include('schema_viewer.urls')),
...,
]
- Run the project
python manange.py runserver
SCHEMA_VIEWER = {
'apps': [
'contenttypes',
'my_app',
],
'exclude': {
'auth': ['User'],
'my_app': ['SomeModel'],
},
}
MIT