<commit_before>===============================================
django-dashing
===============================================
`django-dashing` is a customisable, modular dashboard application framework for Django to visualize interesting data about your project. Inspired in the exceptionally handsome dashboard framework Dashing_

Check out a demo over `here <https://django-dashing-demo.herokuapp.com/dashboard/>`_.

.. _Dashing: http://shopify.github.io/dashing/

.. image:: https://dl.dropboxusercontent.com/u/5594456/dashing/dashboard.png
    :alt: HTTPie compared to cURL
    :width: 835
    :height: 835
    :align: center

Prerequisites
===============================================
- Django 1.5.+
- Django Compressor (optional)

Key concepts
===============================================
- Use premade widgets, or fully create your own with css, html, and javascript.
- Use the API to push data to your dashboards.
- Drag & Drop interface for re-arranging your widgets.

Installation
===============================================
1. Install latest stable version from PyPi:

.. code-block:: text

    $ pip install django-dashing

2. Add `dashing` to ``INSTALLED_APPS`` of the your projects.

.. code-block:: python

    INSTALLED_APPS = (
        ...
        'dashing',
    )

3. Include the dashboard URLconf in your project urls.py like this:

.. code-block:: python

    from dashing.utils import router
    ...
    url(r'^dashboard/', include(router.urls)),

4. Start the development server and visit http://127.0.0.1:8000/dashboard/
   to view the dummy dashboard.

Quick Start
===============================================

To make your own dashboard and retrieves the data from django you should:

1. Create a django dashboard application with a `widgets.py` file

2. Create your widget extended from **NumberWidget**, **ListWidget**, **GraphWidget** or simply **Widget** (from dashing.widgets), for example `see <https://github.com/individuo7/django-dashing-demo-app/blob/master/django_dashing_demo_app/widgets.py>`_.

.. code-block:: python

3. Register your widget in `urls.py` like:

.. code-block:: python

    from django.conf.urls import url, include
    from dashing.utils import router

    from project.dashboard.widgets import CustomWidget

    router.register(CustomWidget, 'custom_widget')

    urlpatterns = [
        url(r'^dashboard/', include(router.urls)),
    ]

Create a dashing-config.js file with a widget that retrive the data in your static directory like:

.. code-block:: javascript

    var myDashboard = new Dashboard();
    myDashboard.addWidget('customWidget', 'Number', {
        getData: function () {
            var self = this;
            Dashing.utils.get('custom_widget', function(data) {
                $.extend(self.data, data);
            });
        },
        interval: 3000
    });

Also if you want to locate the config file in a different directory you can create a `dashing/dashboard.html` file in your **TEMPLATE_DIRS** and replace the **config_file** block to the route of your javascript config file, see the `docs <http://django-dashing.readthedocs.org/en/latest/getting-started.html#template-file>`_.

Testing<commit_msg>fix error in Readme, closes #47<commit_after>===============================================
django-dashing
===============================================
`django-dashing` is a customisable, modular dashboard application framework for Django to visualize interesting data about your project. Inspired in the exceptionally handsome dashboard framework Dashing_

Check out a demo over `here <https://django-dashing-demo.herokuapp.com/dashboard/>`_.

.. _Dashing: http://shopify.github.io/dashing/

.. image:: https://dl.dropboxusercontent.com/u/5594456/dashing/dashboard.png
    :alt: HTTPie compared to cURL
    :width: 835
    :height: 835
    :align: center

Prerequisites
===============================================
- Django 1.5.+
- Django Compressor (optional)

Key concepts
===============================================
- Use premade widgets, or fully create your own with css, html, and javascript.
- Use the API to push data to your dashboards.
- Drag & Drop interface for re-arranging your widgets.

Installation
===============================================
1. Install latest stable version from PyPi:

.. code-block:: text

    $ pip install django-dashing

2. Add `dashing` to ``INSTALLED_APPS`` of the your projects.

.. code-block:: python

    INSTALLED_APPS = (
        ...
        'dashing',
    )

3. Include the dashboard URLconf in your project urls.py like this:

.. code-block:: python

    from dashing.utils import router
    ...
    url(r'^dashboard/', include(router.urls)),

4. Start the development server and visit http://127.0.0.1:8000/dashboard/
   to view the dummy dashboard.

Quick Start
===============================================

To make your own dashboard and retrieves the data from django you should:

1. Create a django dashboard application with a `widgets.py` file

2. Create your widget extended from **NumberWidget**, **ListWidget**, **GraphWidget** or simply **Widget** (from dashing.widgets), for example `see <https://github.com/individuo7/django-dashing-demo-app/blob/master/django_dashing_demo_app/widgets.py>`_.

.. code-block:: python

3. Register your widget in `urls.py` like:

.. code-block:: python

    from django.conf.urls import url, include
    from dashing.utils import router

    from project.dashboard.widgets import CustomWidget

    router.register(CustomWidget, 'custom_widget')

    urlpatterns = [
        url(r'^dashboard/', include(router.urls)),
    ]

Create a dashing-config.js file with a widget that retrive the data in your static directory like:

.. code-block:: javascript

    var myDashboard = new Dashboard();
    myDashboard.addWidget('customWidget', 'Number', {
        getData: function () {
            var self = this;
            Dashing.utils.get('custom_widget', function(data) {
                $.extend(self.scope, data);
            });
        },
        interval: 3000
    });

Also if you want to locate the config file in a different directory you can create a `dashing/dashboard.html` file in your **TEMPLATE_DIRS** and replace the **config_file** block to the route of your javascript config file, see the `docs <http://django-dashing.readthedocs.org/en/latest/getting-started.html#template-file>`_.

Testing
{'fraction_non_alphanumeric': 0.18445240691696527, 'fraction_numerical': 0.011839850443994392, 'mean_word_length': 3.7696879643387815, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5947713', 'n_tokens_mistral': 1851, 'n_tokens_neox': 1720, 'n_words': 586}