Coder Social home page Coder Social logo

Comments (2)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 30, 2024
rename the directory django_graphviz-0.1 to django_graphviz if you're using the
default project. Or add 

'yourproject.graphviz' to settings.py INSTALLED_APPS

Original comment by [email protected] on 24 Aug 2009 at 6:39

from django-graphviz.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 30, 2024
Here are my steps documented:


Printing Django Models as block diagrams

Installing GraphVis support on OSX - Mark Eckdahl
2011-10-26


Tasks accomplished:
Install Graphics Engine (GraphVis)
Install Python driver (pygraphvis)
Install application to export models (django-extensions)
Export models to image files from command line



After a bit of a hassle here is what worked for me on Snow Leopard version of 
OSX.

1.  Download and install the Application GraphVis version 2.26.3 version (a bit 
more OSX friendly than 2.28 from notes on site) - This is the graphics display 
engine software.

    http://www.graphviz.org/pub/graphviz/stable/macos/snowleopard/


2.  Install Python driver to link to GraphVis - pygraphvis

    pip install pygraphviz


3.  Install django-command-extensions - Note I actually downloaded source and 
ran [sudo python setup.py install] from source folder as part of my debugging, 
but probably overkill.

      pip install django-extensions

3b. I copied the django_extensions folder from the distribution into my [apps] 
folder for my Django project, note this is not the top level folder, but a sub 
folder.  Again probably overkill.

4.  Edit your settings.py file and add the following in the INSTALLED_APPS 
(generally you will have a list, and just add {'django_extensions',} to the 
list.

      INSTALLED_APPS = ('django_extensions',)

5.  Then with your project directory as your current directory, enter this code 
at the command prompt: (Note: /path/to/image{.png} should be replaced with the 
your desired file name for generated image file)

      python manage.py graph_models -a -g -o /path/to/image.png








=============================================
Original reference From:
http://ygamretuta.me/2011/02/08/django-1-2-output-an-image-graph-of-your-models/



Django 1.2 – Output An Image Graph of Your Models

   1.

      install required packages by entering this code:

      apt-get install graphviz python-pygraphviz graphviz-dev

   2.

      then install pygraphviz in Python

      pip install pygraphviz

   3.

      install django-command-extensions

      pip install django-extensions

   4.

      then edit your settings.py file and add the following in the INSTALLED_APPS

      INSTALLED_APPS = ('django_extensions',)

   5.

      then with your project directory as your current directory, enter this code

      python manage.py graph_models -a -g -o /path/to/image.png

and that’s it!

Original comment by mark.eckdahl on 26 Oct 2011 at 10:17

from django-graphviz.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.