Coder Social home page Coder Social logo

jbrass / django-dashing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from talpor/django-dashing

0.0 1.0 0.0 1.31 MB

django-dashing is a customisable, modular dashboard application framework for Django to visualize interesting data about your project. Inspired in the dashboard framework Dashing

License: BSD 3-Clause "New" or "Revised" License

Python 1.46% CSS 1.25% JavaScript 96.62% HTML 0.67%

django-dashing's Introduction

Note: An updated version with Python3/Django3+ support maintained by wickeym can be installed by doing pip install django3-dashing

django-dashing

https://travis-ci.org/talpor/django-dashing.svg?branch=master

Note this fork is to support Django 3, which dropped support for Python2.

NOTE: Using Python 3.9 for development as shown in pipfile, but Python 3.6 or greater should work too.

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

dashboard screenshot

Prerequisites

  • Django 3+
  • 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:
$ pip install django-dashing
  1. Add dashing to INSTALLED_APPS of the your projects.
INSTALLED_APPS = (
    ...
    'dashing',
)
  1. Include the dashboard URLconf in your project urls.py like this:
from dashing.utils import router
...
path('dashboard/', include(router.urls)),
  1. 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.
  3. Register your widget in urls.py like:
from django.urls import include, path
from dashing.utils import router

from project.dashboard.widgets import CustomWidget

router.register(CustomWidget, 'custom_widget')

urlpatterns = [
    path('dashboard/', include(router.urls)),
]

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

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.

Testing

Install dependencies.

$ npm install
$ pip install -r requirements.txt

Run tests.

$ npm test

Links

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.