Django detect cyclic
Python JavaScript
Switch branches/tags
Nothing to show
Latest commit 61bd8b0 Sep 14, 2012 @goinnn goinnn Add dependence


Django detect cyclic

Application to detect cyclic imports. With this application you can analyze the dependence of your applications



In your




In your

urlpatterns = patterns('',

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


Make sure that you have in your urls jsi18nurl:

js_info_dict = {
    'packages': ('',),

urlpatterns = patterns('',

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



  • The nodes are applications, or (if you use the option “Show modules”) modules in the applications
  • One edge means that the source node imports from the destination node
  • Every edge of a cycle has the same background color and the label contains “Cycle X”
  • The labels of the edges contain the weight in parentheses
  • If 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 method

Possibles Errors

It is possible that the next links are interested if you can some problem:

It is possible that you have to remove the pyc files:

find -iname "*.pyc" -exec rm "{}" \;


You have two ways, you can run a command:

python detect_cyclic
python detect_cyclic --include-apps="app1,app6,app7,app11" --file-name="my_graph.svg" --exclude-packages="migrations,templatetags" --verbosity=2
python detect_cyclic --include-apps="app1,app6" --show-modules --file-name="my_graph.svg" --exclude-packages="migrations" --verbosity=2
python detect_cyclic --include-apps="app1,app6" --only-cyclic --file-name="my_graph.svg" --exclude-packages="migrations" --verbosity=2

Or you can access via web to the wizard:



To see more examples click in examples