django-archan

A Django app that displays dependency matrices and project architecture information


Keywords
architecture analysis dependency matrix dsm ontology, deprecated
License
MPL-2.0
Install
pip install django-archan==0.0.4

Documentation

django-archan

Latest Version Development Status Download format Build Status Supported Python versions License

A Django app that displays dependency matrices using dependenpy Python module, and also project architecture information, using archan Python module.

It uses Twitter Bootstrap, JQuery, JQuery-UI and D3js libraries.

Screenshot Matrix

http://image.noelshack.com/fichiers/2015/14/1427998026-depmat.png

Screenshot Architecture

Architecture analysis tab

Motivation

The archan Python module implements some of the design principles described in "The Protection of Information in Computer Systems" paper, written by Jerome H. Saltzer and Michael D. Schroeder. The aim of django-archan is to automate the analysis of the dependency matrix of your project (generated by the dependenpy Python module), and display it in a nice user-friendly way.

Installation

Just run:

pip install django-archan

Then add django-archan to the installed apps of your Django project:

# settings.py

INSTALLED_APPS += ('darchan')

Also add the urls into your main urls.py, something like:

# urls.py

...
url(r'^darchan/', include('darchan.urls'), name='darchan'),
...

Configuration

The following options are available:

  • DARCHAN_PACKAGE_LIST : the list of installed packages that will be scanned to build the dependency matrices. Please read the documentation of dependenpy for more details.
  • DARCHAN_TEMPLATE : the path to the template that will include django_archan HTML/CSS/JS contents. The purpose of this option is to make django archan template inherit from your HTML base.

Usage

# settings.py

DARCHAN_TEMPLATE = "my_app/my_custom_template.html"
<!-- my_app/my_custom_template.html -->

{% extends "my_core/my_base.html" %}
{% load static %}

{% block my_content %}
    {% include "darchan/matrix.html" %}
{% endblock %}

{% block my_js %}
    {# overriden to remove inclusion of another jquery script #}
    {# that would enter in conflict with darchan's one #}
{% endblock %}
# settings.py

DARCHAN_PACKAGE_LIST = [
    'framework', ['django'],
    'core_lib', [
        'suit',
        'captcha',
        'imagekit',
        'markdown_deux',
        'rosetta',
        'django_forms_bootstrap',
        'pagedown',
        'axes',
        'avatar',
        'cities_light',
        'datetimewidget',
        'smart_selects',
        'modeltranslation',
        'djangobower'],
    'app_lib', [
        'django_zxcvbn_password',
        'cs_models',
        'news',
        'dataforms',
        'darchan'],
    'app_module', [
        'complex',
        'genida',
        'members',
        'questionnaires'],
    'broker', ['security']
]

Warning

It is mandatory that you use the following names for naming your groups of packages, otherwise an exception will be raised by the archan module:

  • framework: obviously, django
  • core_lib: the django packages you installed and you didn't modify
  • app_lib: the django packages that you wrote or modified
  • app_module: the main features of your project (packages in your project root, not in virtualenv)
  • broker: the modules that are used for security purposes
  • data: the modules that only deal with data (no views, no forms, ...)

However, it does not mean that YOU HAVE to use ALL these names: you could take the above example and get rid of the 'broker' group, or any other group if you don't need it. You can also put all your packages in one group called 'app_module'

In the future it will maybe be possible to give the names you want, by associating them with the previous mentioned one in some way, but for now you can't.

Now all you need to do is to add a link somewhere on your pages, like this:

<a href="{% url "view_last_matrix" %}">
    Click to see the last generated matrix, or to generate one if there are not.
</a>

<!-- or like this, matching the above urls.py example: -->

<a href="/darchan/view_matrix/">
    Click to see the last generated matrix, or to generate one if there are not.
</a>

Please check django-archan's urls.py file to see the other available URLs.