menu

Material Dashboard

Introduction

Material Dashboard is the Material Frontend module to quickly construct end-user dashboards.

Installation

Material Dashboard comes as part of django-material package.

To install it, just add the material.dashboard in the INSTALLED_APPS setting

INSTALLED_APPS = (
     ...
     'material.frontend',
     'material.dashboard',
     ...
)

After installation, there is the default user dashbaord shown. When any other custom dashboard is registred, they would replace the default dashboard.

Quick Start

from material import dashboard
from django.template.loader import render_to_string

def users_count(request):
    return render_to_string('material/dashboard/counter.html', {
        'title': 'Users',
        'count': User.objects.count(),
        'icon': '<i class="material-icons">account_circle</i>'
    })

dashboard.register(
    Dashboard('User', [user_count])
)

API

class material.dashboard.Dashboard(name, children, permission=None, permission_obj=None)
media

Return all media required to render the element on this dashboard.

class material.dashboard.Row(*children)
media

Return all media required to render the element on this dashboard.

class material.dashboard.Column(*children)
media

Return all media required to render the element on this dashboard.