实体联系图自动生成系统 关于pygraphviz的依赖 1 2 3 4 5 apt install graphviz-dev sudo pip install pygraphviz --install-option="--include-path=/usr/local/include/graphviz/" --install-option="--library-path=/usr/local/lib/graphviz" # 在安装的时候指定graphviz的路径 在windows下要指定
pygraphviz 接受 dot ,改为 graphviz 应无变化
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
使用gunicorn部署flask项目
安装gunicorn
假设flask的app.p
1 2 3 4 5 6 from flask import Flaskapp = Flask(__name__) @app.route("/") def hello () : return "Hello World!"
在shell中输入
1 2 gunicorn -w 3 -b 127.0 .0 .1 :5000 app:app
sqlalchemy 涉及到的知识点 sqlalchemy.ext.declarative.declarative_base sqlalchemy.orm.relationship 引用到的包 1 2 3 4 5 from sqlalchemy import Table, Column, Integer, ForeignKeyfrom sqlalchemy.orm import relationshipfrom sqlalchemy.ext.declarative import declarative_baseBase = declarative_base()
一对多 父节点和子节点
1 2 3 4 5 6 7 8 9 class Parent (Base) : __tablename__ = 'parent' id = Column(Integer, primary_key=True ) children = relationship("Child" ) class Child (Base) : __tablename__ = 'child' id = Column(Integer, primary_key=True ) parent_id = Column(Integer, ForeignKey('parent.id' ))
metadata型,declarative型
column属性:
数据类型:
关系
json to base
属性:
1 {"tablename" :"base" ,"columns" :"[{" name":" xxx":}]" ,"relationships" :"xxx" }
gua