前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Django Models UML

Django Models UML

原创
作者头像
vanguard
修改2021-01-05 10:36:46
7660
修改2021-01-05 10:36:46
举报
文章被收录于专栏:vanguardvanguard

Generate a class diagram based on GraphViz(pygraphviz) and django django-extensions

代码语言:shell
复制
pip install django-extensions
代码语言:python
复制
INSTALLED_APPS = (
 ...
 'django_extensions',
 ...
)
代码语言:shell
复制
pip install pygraphviz
python manage.py graph_models -a -o graph.png

when meet errors like "GraphViz's executables not found":

代码语言:shell
复制
# sudo apt install linuxbrew-wrapper
# sudo apt-get -f install
# sudo apt-get install graphviz
brew install graphviz
# check in python: import pygraphviz
# when I found two python3 version (3.9 & 3.8)
# brew uninstall --ignore-dependencies python3
pip install pygraphviz
pip install pydotplus
# pip install --upgrade django
# pip install --upgrade Pillow
# brew uninstall --ignore-dependencies python3  

my result is as following:

output UML class graph image
output UML class graph image

Reference as following

https://django-extensions.readthedocs.io/en/latest/graph_models.html#example-usage

Generate UML class diagrams from django models

https://simpleit.rocks/python/django/generate-uml-class-diagrams-from-django-models/

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
http://www.vxiaotou.com