Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/goinnn/django-detect-cyclic
Django detect cyclic
https://github.com/goinnn/django-detect-cyclic
Last synced: 6 days ago
JSON representation
Django detect cyclic
- Host: GitHub
- URL: https://github.com/goinnn/django-detect-cyclic
- Owner: goinnn
- Created: 2012-07-05T17:04:52.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-09-01T12:47:00.000Z (about 9 years ago)
- Last Synced: 2024-10-15T04:29:19.879Z (20 days ago)
- Language: Python
- Size: 5.23 MB
- Stars: 22
- Watchers: 3
- Forks: 7
- Open Issues: 6
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES
Awesome Lists containing this project
- starred-awesome - django-detect-cyclic - Django detect cyclic (Python)
README
.. contents::
====================
Django detect cyclic
====================Application to detect cyclic imports.
With this application you can analyze the dependence of your applications.. image:: https://github.com/goinnn/django-detect-cyclic/raw/master/examples/example-only-cyclic-exclude.png
Requeriments
============* `python-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)Installation
============In 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),
)
Caption
=======* 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 methodPossibles 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-gvIt is possible that you have to remove the pyc files:
::
find -iname "*.pyc" -exec rm "{}" \;
Usage
=====You 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/
Examples
========To see more examples click in `examples `_