whats-open activity https://git.gmu.edu/hjozwiak/whats-open 2019-02-28T20:59:08Z tag:git.gmu.edu,2019-02-28:20246 Michael R Lundquist opened issue #1: Generate an ERD as a CI build artifact a... 2019-02-28T20:59:08Z mlundqu2 Michael R Lundquist

You can automatically generate ERD diagrams for Django models by installing the django-extensions package, adding it to your INSTALLED_APPS, and running python manage.py graph_models -a (-a for all models, or you can specify a specific subset). Then you can use something like graphviz to generate an ERD from it.

Create a requirements-dev.txt, and add it there. Then you should create a settings folder with base.py, development.py, production.py (and maybe a staging.py in the future).

In the settings/development.py, you can do something like this:


The main reason to have a separate `settings/development.py` is to enable you to have separate things for your development and CI work. For example, you could have a Gitlab CI job that does something like
  - apt-get install -y graphviz

  image: library/python:3.7
  type: test
      - erd.png
    expire_in: 1 week
    - python manage.py graph_models -a > erd.dot
    - dot -Tpng erd.dot -o erd.png```
tag:git.gmu.edu,2018-02-01:13842 Hunter T Jozwiak created project Hunter T Jozwiak / whats-open 2018-02-01T00:58:57Z hjozwiak Hunter T Jozwiak