Set of widgets to build dashboards for Django projects

byashimov, updated 🕥 2022-01-22 03:55:31

Welcome to django-controlcenter!

Get all your project models on one single page with charts and whistles.

.. image:: https://cloud.githubusercontent.com/assets/1560043/14309295/b8c9aad0-fc05-11e5-96d0-44293d2d07ff.png :alt: django-controlcenter

Attention!

Unfortunately, I have no time to add new features. Please make PR if you need one:

  • branch from master
  • provide tests
  • add docs
  • update changelog

That's it.

Rationale

Django-admin_ is a great tool to control your project activity: new orders, comments, replies, users, feedback -- everything is here. The only struggle is to switch between all those pages constantly just to check them out for new entries.

With django-controlcenter you can have all of your models on one single page and build beautiful charts with Chartist.js_. Actually they don't even have to be a django models, get your data from wherever you want: RDBMS, NOSQL, text file or even from an external web-page, it doesn't matter.

Quickstart

Install django-controlcenter:

.. code-block:: console

pip install -U django-controlcenter

Create a dashboard file with unlimited number of widgets and dashboards:

.. code-block:: python

from controlcenter import Dashboard, widgets
from project.app.models import Model

class ModelItemList(widgets.ItemList):
    model = Model
    list_display = ('pk', 'field')

class MyDashboard(Dashboard):
    widgets = (
        ModelItemList,
    )

Update settings file:

.. code-block:: python

INSTALLED_APPS = [
    ...
    'controlcenter',
    ...
]

CONTROLCENTER_DASHBOARDS = (
    ('mydash', 'project.dashboards.MyDashboard'),
)

Plug in urls:

.. code-block:: python

from django.urls import path
from django.contrib import admin
from controlcenter.views import controlcenter

urlpatterns = [
    path('admin/', admin.site.urls),
    path('admin/dashboard/', controlcenter.urls),
    ...
]

Open /admin/dashboard/mydash/ in browser.

Documentation

Check out the docs_ for more complete examples.

Compatibility

.. image:: https://travis-ci.org/byashimov/django-controlcenter.svg?branch=master :alt: Build Status :target: https://travis-ci.org/byashimov/django-controlcenter

.. image:: https://codecov.io/github/byashimov/django-controlcenter/coverage.svg?branch=master :alt: Codecov :target: https://codecov.io/github/byashimov/django-controlcenter?branch=master

Tested on py 3.5—3.10 and django 1—4.

Credits

This project uses Chartist.js_, Masonry.js_ and Sortable.js_.

Changelog

0.3.1 ~~~~~

  • Support django 4.0, python 3.10. Thanks to @mick88.
  • Fixed LineChart example. Thanks to @virtosubogdan.

0.3.0 ~~~~~

  • Support django 3.0
  • Python 3 only

0.2.9 ~~~~~

  • chartist-plugin-pointlabels temporary fix
  • Added sorting triangles to ItemList
  • ItemList header is now always displayed regardless sortability
  • Other misc improvements

Thanks to @minusf.

0.2.8 ~~~~~

  • Fixed key_value_list.html widget template syntax error.
  • Fixed attribute typo widget.chartist.point_labels -> point_lables.

Thanks to @minusf.

0.2.7 ~~~~~

  • New TimeSeriesChart widget. Thanks to @pjdelport.
  • New "simple" widgets: ValueList and KeyValueList. Thanks to @tonysyu.
  • Bunch of fixes and improvements, thanks again to @pjdelport.

0.2.6 ~~~~~

  • Fixed navigation menu links, thanks to @editorgit

0.2.5 ~~~~~

  • It's now possible to use slugs for dashboards instead of those indexes in CONTROLCENTER_DASHBOARDS. The old behaviour is supported too.

0.2.4 ~~~~~

  • It's compatible with django 1.8—2.1 now
  • Custom app name can be passed to ControlCenter class

0.2.3 ~~~~~ - Updated column grid, thanks to @pauloxnet. - Grammar fixes, thanks to @danielquinn. - It's should be possible now to use a custom dashboard view with a custom template.

0.2.2 ~~~~~ - dashboard.html now extends admin/base_site.html instead of admin/base.html in order to display branding block. Thanks to @chadgh. - Updated jsonify tag filter, thanks to @k8n.

0.2.1 ~~~~~ - Django 1.10 support. Tested in tox only. - Updated the SingleBarChart example, thanks to @greeve.

0.2.0 ~~~~~ - Unlimited dashboards support. - Configuration constructor is moved to a separate project -- django-pkgconf_. It's a dependency now.

0.1.2 ~~~~~ - Chart i series color fix. Thanks to @uncleNight. - Docs. Finally.

0.1.1 ~~~~~ - Better responsive experience.

0.1.0 ~~~~~ - First public release.

.. _Chartist.js: http://gionkunz.github.io/chartist-js/ .. _Masonry.js: http://masonry.desandro.com/ .. _Sortable.js: http://github.hubspot.com/sortable/docs/welcome/ .. _Django-admin: https://docs.djangoproject.com/en/stable/ref/contrib/admin/ .. _django-pkgconf: https://github.com/byashimov/django-pkgconf .. _docs: http://django-controlcenter.readthedocs.io/en/latest/

Issues

How to create customized widget design to show a counter like thing ?

opened on 2020-02-13 19:44:54 by sarkkk

Counter is a basic things to be added on any dashboard. Is there any way to do such things on django-controlcenter ? dash

Barchart series not assigned color when there are more then 15 bars

opened on 2019-12-30 22:34:09 by firstTimeCaller

I have created a SingleBarChart with 30 series. Chartist assigns each series a class ct-series-{name}. With name looping from a to z. The django-controlcenter static file 'chartist-default-colors.css' has colors defined for class a to o. Classes p to z do not have a color defined, and therefore do not display on the chart.

Would it be possible to append 'chartist-default-colors.css' to contain classes ct-series-p to ct-series-z?

Replacing admin dashboards with django-controlcenter dashboards

opened on 2019-07-20 13:26:45 by minholi

There is a way to use dashboards created with django-controlcenter like django-admin-tools does with CustomIndexDashboard and CustomAppIndexDashboard?

https://django-admin-tools.readthedocs.io/en/latest/customization.html#customizing-the-dashboards

object is not iterable?

opened on 2019-07-17 10:15:07 by silly362967856

I just leave the queryset as default. And itemlist just give me the info. Python 2.7, Django 1.11

[feature request] integration with django-admin-tools

opened on 2019-06-11 08:24:25 by daadu

django-admin-tools being a very popular app for admin, i would want the controlcentre widgets to be intgerated with it.

Pagination for ItemList

opened on 2019-01-24 17:03:02 by fsto

When ItemLists become big it'd be amazing if django-controlcenter could offer pagination.

Murad Biashimov
GitHub Repository

django dashboard admin-dashboard