django-detect-cyclic is a Django app to detect cyclic imports. With this application you can analyze the dependence of your applications.
Installation
In your settings.py:
INSTALLED_APPS = (
'django_detect_cyclic',
)
Caption
- The nodes are the applications, or the modules of the applications (if you use the option show-modules)
- One edge means that the node source import the node destination
- When there is a cycle the edge has a background color (the same color in all the cycle), and it label contains "Cycle X"
- The label of the edges contains the weight in parentheses
- If you use the options show-modules, each node has a background color. If two nodes are to the same application, they have the same background color.
Possibles Errors
It is possible that the next links are interested if you can some problem:
- http://code.google.com/p/python-graph/issues/detail?id=15
- http://stackoverflow.com/questions/2133767/using-python-graphviz-importerror-no-module-named-gv
It is possible that you have to remove the pyc files:
find -iname "*.pyc" -exec rm "{}" \;
Usage (Examples)
python manage.py detect_cyclic
python manage.py detect_cyclic --include-apps="app1,app6,app7,app11" --file-name="my_graph.svg" --exclude-packages="migrations,templatetags" --verbosity=2
python manage.py detect_cyclic --include-apps="app1,app6" --show-modules --file-name="my_graph.svg" --exclude-packages="migrations" --verbosity=2
python manage.py detect_cyclic --include-apps="app1,app6" --only-cyclic --file-name="my_graph.svg" --exclude-packages="migrations" --verbosity=2
To see other examples click in examples.
What is new in this release:
- Fix some errors
- Adapt the code to the last version of pyplete. Now the detect the relative imports, something like this:
- from models import MyModel # from the same directory of the models.py
- And this:
- from .models import MyModel # from the same directory of the models.py
What is new in version 0.0.7:
- Now jquery.graphviz has a stable version (0.0.1, Tested in Chrome, FireFox, Safari and IE9)
- Detail to the js
What is new in version 0.0.6:
- Format svg-js (beta). Change dracula js to jquery.graphviz.js (Tested in Chrome and FireFox)
What is new in version 0.0.5:
- Change force-colors option to use-colors option
- Change distribution of the wizard
- Usability
What is new in version 0.0.4:
- Wizard to create graphs (/admin/detect_cyclic/)
- Format svg-js (beta)
What is new in version 0.0.2:
- Documentation and examples
Requirements:
- Python
- Django
- python-graph-core
- python-graph-dot
- PySmell
- pyplete
Comments not found