Skip to main content
Help us improve Python packaging – donate today!

Django application to detect cyclic imports

Project Description

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')),



  • 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.
  • If a edge is dotted, every import between these two nodes is into a function

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


0.0.4 (2012-07-12)

  • Wizard to create graphs (/admin/detect_cyclic/)
  • Format svg-js (beta)

0.0.3 (2012-07-10)

  • Add the option “scope-global”, this ignore the imports into the functions
  • Now if the verbosity option is 1, only show the errors
  • Now 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 edge
  • Now 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” option
  • Optimizations
  • New option “dotted-scope-local”. If the all import between two nodes are into a function the edge will be dotted
  • Fixed some little errors

0.0.2 (2012-07-09)

  • Documentation and examples

0.0.1 (2012-07-09)

  • Initial release.

Release history Release notifications

History Node


History Node


History Node


History Node


History Node


This version
History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django-detect-cyclic-0.0.4.tar.gz (76.6 kB) Copy SHA256 hash SHA256 Source None Jul 12, 2012

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page