manage.pyofferings. One of which is
./manage.py graph_models [appname]which will generate a nice graph displaying the relationships among all of your Models. This comand needs pyGraphViz, though, and I was a little disappointed when i discovered I couldn't install pyGraphViz with
pip install pygraphviz. (ok, a lot disappointed).
I eventually got this working, and here's how:
- First, install the development snapshot of GraphViz: http://graphviz.org/Download_macos.php (I used graphviz-2.27.20100713.0445.pkg)
- Next, download the pygraphviz source code from http://networkx.lanl.gov/pygraphviz/download.html. (Again, I got pygraphviz-0.99.1/ )
- Here's the fun part. You need to edit pygraphviz's setup.py file (located at pygraphviz-0.99.1/setup.py for me). Find the following two lines of code:
And change them to
You also might want to verify that the above directories exist.
- Now, active your virtualenv (workon <whatever_your_virtualenv_is_named>)
- Finally, just run
python setup.py install
That's it! This installed pygraphviz in my activated virtualenv, and I can now use
./manage.py graph_modelsto my heart's desire.
I should mention that I'm using distribute (and it may be safe to assume that if you're using virtualenv, you're probably also using distribute). comments powered by Disqus