Package: django-detect-cyclic
ContentsDjango detect cyclicRequerimentsInstallationCaptionPossibles ErrorsUsageExamplesReleases0.0.9  (2012-09-02)0.0.8 (2012-08-09)0.0.7 (2012-07-25)0.0.6 (2012-07-23)0.0.5 (2012-07-13)0.0.4 (2012-07-12)0.0.3 (2012-07-10)0.0.2 (2012-07-09)0.0.1 (2012-07-09)Django detect cyclicApplication to detect cyclic imports.
With this application you can analyze the dependence of your applicationsRequerimentspython-graph-core(1.8.1)python-graph-dot(1.8.1)pysmell(0.7.3)pyplete(0.0.2)django-form-admin(0.3.2) (optional)jquery.graphviz(fronzen into the app, only to svg-js format)InstallationIn your settings.py:INSTALLED_APPS = (

    'django_detect_cyclic',

)In your urls.py:urlpatterns = patterns('',

    (r'^admin/detect_cyclic/', include('django_detect_cyclic.urls')),

)Make sure that you have in your urls jsi18nurl:js_info_dict = {
    'packages': ('your.app.package',),
}

urlpatterns = patterns('',

    url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),

)CaptionThe nodes are applications, or (if you use the option “Show modules”) modules in the applicationsOne edge means that the source node imports from the destination nodeEvery edge of a cycle has the same background color and the label contains “Cycle X”The labels of the edges contain the weight in parenthesesIf you use the “Show modules” option, each node will have a background color. If two nodes are from the same application, they will have the same background color.If an edge is dotted, every import in the source happens at runtime, whithin the body of a function or methodPossibles ErrorsIt is possible that the next links are interested if you can some problem:http://code.google.com/p/python-graph/issues/detail?id=15http://stackoverflow.com/questions/2133767/using-python-graphviz-importerror-no-module-named-gvIt is possible that you have to remove the pyc files:find -iname "*.pyc" -exec rm "{}" \;UsageYou have two ways, you can run a command: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=2Or you can access via web to the wizard:/admin/detect_cyclic/ExamplesTo see more examples click inexamplesReleases0.0.9  (2012-09-02)Fix some errorsAdapt 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.pyAnd this:from .models import MyModel # from the same directory of the models.py0.0.8 (2012-08-09)Loaded a templatetag, and with this you get a errorNow works the js in Django 1.4Fix a error when you had some application repeat in your settings (INSTALLED_APPS)Fix a csr error when you click in download the graph and the format is svg-js0.0.7 (2012-07-25)Now jquery.graphviz has a stable version (0.0.1, Tested in Chrome, FireFox, Safari and IE9)Detail to the js0.0.6 (2012-07-23)Format svg-js (beta). Change dracula js tojquery.graphviz.js(Tested in Chrome and FireFox)0.0.5 (2012-07-13)Change force-colors option to use-colors optionChange distribution of the wizardUsability0.0.4 (2012-07-12)Wizard to create graphs (/admin/detect_cyclic/)Format svg-js (alpha)Fix a little errors0.0.3 (2012-07-10)Add the option “scope-global”, this ignore the imports into the functionsNow if the verbosity option is 1, only show the errorsNow when a node (with show-modules) has the same name that a application, the node name will be app_name.__init__Now the label of the cycle edges has the same color that the edgeNow disabled the colors of the edge and nodes when the format is not svg. But it is possible enabled if you use the “force color” optionOptimizationsNew option “dotted-scope-local”. If the all import between two nodes are into a function the edge will be dottedFixed some little errors0.0.2 (2012-07-09)Documentation and examples0.0.1 (2012-07-09)Initial release.