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