<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_

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

Prerequisites
===============================================
- Django 1.5.+

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 polls URLconf in your project urls.py like this:

.. code-block:: python
    
    url(r'^dashboard/', include('dashing.urls')),

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


Getting Started
===============================================

To create a custom dashboard you need create a ``dashing-config.js`` file in the static directory and optionally a custom ``dashing/dashboard.html`` template file.

Config File 
-----------

You need put the ``dashing-config.js`` in the static directory (you can change the patch and name if you wrote a template file and start to create widgets for your project.

The dashing config file should start with the creation of a new dashboard ``var dashboard = new Dashboard();`` and start to place widgets with the following syntax ``dashboard.addWidget(<name_of_widget>, <type_of_widget>, <options>);`` where `name_of_widget` is the name that describe the objective of the widget (should be unique) `type_of_widget` is a valid widget type (Clock, Graph, List, Number) and options depends of each widget.

Template File
-------------

You can create a `dashboard.html` file to specify which widgets you can use or add your custom widgets, also add stylesheets and extra scripts. You will place inside the template directory in ``dashing/dashboard.html``

Python Widget Classes
----------------------

Optionally this app provide an useful set of classes to return the expected data for the default widgets, you can create a `widget.py` file and inherit of these classes or create your own widgets inherit from ``dashing.widgets.Widget``.

.. code-block:: python

    class Widget(JSONResponseMixin, View):
        def get(self, request, *args, **kwargs):
            context = self.get_context()
            return HttpResponse(json.dumps(context), content_type="application/json")

        def render_to_response(self, context, **response_kwargs):
            return self.render_to_json_response(context, **response_kwargs)


Dashboards
===============================================

Single Dashboard 
----------------

To initialize a single dashboard you need create a Dashboard object and pass valid options as shown below:

.. code-block:: javascript
<commit_msg>Update index.rst<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_

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

Prerequisites
===============================================
- Django 1.5.+

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 polls URLconf in your project urls.py like this:

.. code-block:: python
    
    url(r'^dashboard/', include('dashing.urls')),

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


Getting Started
===============================================

To create a custom dashboard you need create a ``dashing-config.js`` file in the static directory and optionally a custom ``dashing/dashboard.html`` template file.

Config File 
-----------

You need put the ``dashing-config.js`` in the static directory (you can change the patch and name if you wrote a template file and start to create widgets for your project.

The dashing config file should start with the creation of a new dashboard ``var dashboard = new Dashboard();`` and start to place widgets with the following syntax ``dashboard.addWidget(<name_of_widget>, <type_of_widget>, <options>);`` where `name_of_widget` is the name that describe the objective of the widget (should be unique) `type_of_widget` is a valid widget type (Clock, Graph, List, Number) and options depends of each widget.

Template File
-------------

You can create a `dashboard.html` file to specify which widgets you can use or add your custom widgets, also add stylesheets and extra scripts. You will place inside the template directory in ``dashing/dashboard.html``

Python Widget Classes
----------------------

Optionally this app provide an useful set of classes to return the expected data for the default widgets, you can create a `widgets.py` file and inherit of these classes or create your own widgets inherit from ``dashing.widgets.Widget``.

.. code-block:: python

    class Widget(JSONResponseMixin, View):
        def get(self, request, *args, **kwargs):
            context = self.get_context()
            return HttpResponse(json.dumps(context), content_type="application/json")

        def render_to_response(self, context, **response_kwargs):
            return self.render_to_json_response(context, **response_kwargs)


Dashboards
===============================================

Single Dashboard 
----------------

To initialize a single dashboard you need create a Dashboard object and pass valid options as shown below:

.. code-block:: javascript

{'fraction_non_alphanumeric': 0.1875379017586416, 'fraction_numerical': 0.004851425106124924, 'mean_word_length': 4.070714834742506, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '2679114', 'n_tokens_mistral': 1692, 'n_tokens_neox': 1591, 'n_words': 707}