Dashboard Modules

Build-In Dashboard Modules

AppList

_images/dashboard_module_app_list.png
class jet.dashboard.modules.AppList(title=None, model=None, context=None, **kwargs)

Shows applications and containing models links. For each model “created” and “change” links are displayed.

Usage example:

from django.utils.translation import ugettext_lazy as _
from jet.dashboard import modules
from jet.dashboard.dashboard import Dashboard, AppIndexDashboard


class CustomIndexDashboard(Dashboard):
    columns = 3

    def init_with_context(self, context):
        self.children.append(modules.AppList(
            _('Applications'),
            exclude=('auth.*',),
            column=0,
            order=0
        ))
exclude = None

Specify models which should NOT be displayed. exclude is an array of string formatted as app_label.model. Also its possible to specify all application models with * sign (e.g. auth.*).

models = None

Specify models which should be displayed. models is an array of string formatted as app_label.model. Also its possible to specify all application models with * sign (e.g. auth.*).

ModelList

_images/dashboard_module_model_list.png
class jet.dashboard.modules.ModelList(title=None, model=None, context=None, **kwargs)

Shows models links. For each model “created” and “change” links are displayed.

Usage example:

from django.utils.translation import ugettext_lazy as _
from jet.dashboard import modules
from jet.dashboard.dashboard import Dashboard, AppIndexDashboard


class CustomIndexDashboard(Dashboard):
    columns = 3

    def init_with_context(self, context):
        self.children.append(modules.ModelList(
            _('Models'),
            exclude=('auth.*',),
            column=0,
            order=0
        ))
exclude = None

Specify models which should NOT be displayed. exclude is an array of string formatted as app_label.model. Also its possible to specify all application models with * sign (e.g. auth.*).

models = None

Specify models which should be displayed. models is an array of string formatted as app_label.model. Also its possible to specify all application models with * sign (e.g. auth.*).

RecentActions

_images/dashboard_module_recent_actions.png
class jet.dashboard.modules.RecentActions(title=None, limit=10, **kwargs)

Display list of most recent admin actions with following information: entity name, type of action, author, date

Usage example:

from django.utils.translation import ugettext_lazy as _
from jet.dashboard import modules
from jet.dashboard.dashboard import Dashboard, AppIndexDashboard


class CustomIndexDashboard(Dashboard):
    columns = 3

    def init_with_context(self, context):
        self.children.append(modules.RecentActions(
            _('Recent Actions'),
            10,
            column=0,
            order=0
        ))
exclude_list = None

Specify actions of which models should NOT be displayed. exclude_list is an array of string formatted as app_label.model. Also its possible to specify all application models with * sign (e.g. auth.*).

include_list = None

Specify actions of which models should be displayed. include_list is an array of string formatted as app_label.model. Also its possible to specify all application models with * sign (e.g. auth.*).

limit = 10

Number if entries to be shown (may be changed by each user personally).

Feed

_images/dashboard_module_feed.png
class jet.dashboard.modules.Feed(title=None, feed_url=None, limit=None, **kwargs)

Display RSS Feed entries with following information: entry title, date and link to the full version

Usage example:

from django.utils.translation import ugettext_lazy as _
from jet.dashboard import modules
from jet.dashboard.dashboard import Dashboard, AppIndexDashboard


class CustomIndexDashboard(Dashboard):
    columns = 3

    def init_with_context(self, context):
        self.children.append(modules.Feed(
            _('Latest Django News'),
            feed_url='http://www.djangoproject.com/rss/weblog/',
            limit=5,
            column=0,
            order=0
        ))
feed_url = None

URL of the RSS feed (may be changed by each user personally).

limit = None

Number if entries to be shown (may be changed by each user personally).

Google Analytics Widgets

Attention

Google Analytics widgets required extra setup

_images/dashboard_module_google_analytics.png

Extra Installation

  • Install python package:
pip install google-api-python-client==1.4.1
  • Specify path to your Google Analytics client_secrets.json (obtained at Google website):
JET_MODULE_GOOGLE_ANALYTICS_CLIENT_SECRETS_FILE = os.path.join(PROJECT_DIR, 'client_secrets.json')
  • Add import to the top of your urls.py:
from jet.dashboard.dashboard_modules import google_analytics_views

Usage Example

from django.utils.translation import ugettext_lazy as _
from jet.dashboard.dashboard import Dashboard, AppIndexDashboard
from jet.dashboard.dashboard_modules import google_analytics


class CustomIndexDashboard(Dashboard):
    columns = 3

    def init_with_context(self, context):
       self.available_children.append(google_analytics.GoogleAnalyticsVisitorsTotals)
       self.available_children.append(google_analytics.GoogleAnalyticsVisitorsChart)
       self.available_children.append(google_analytics.GoogleAnalyticsPeriodVisitors)

Yandex Metrika Widgets

Attention

Yandex Metrika widgets required extra setup

_images/dashboard_module_yandex_metrika.png

Extra Installation

  • Set your Yandex Metrika CLIENT_ID and CLIENT_SECRET (obtained at Yandex Metrika API website):
JET_MODULE_YANDEX_METRIKA_CLIENT_ID = 'YANDEX_METRIKA_CLIENT_ID'
JET_MODULE_YANDEX_METRIKA_CLIENT_SECRET = 'YANDEX_METRIKA_CLIENT_SECRET'
  • Add import to the top of your urls.py:
from jet.dashboard.dashboard_modules import yandex_metrika_views

Usage Example

from django.utils.translation import ugettext_lazy as _
from jet.dashboard.dashboard import Dashboard, AppIndexDashboard
from jet.dashboard.dashboard_modules import yandex_metrika


class CustomIndexDashboard(Dashboard):
    columns = 3

    def init_with_context(self, context):
       self.available_children.append(yandex_metrika.YandexMetrikaVisitorsTotals)
       self.available_children.append(yandex_metrika.YandexMetrikaVisitorsChart)
       self.available_children.append(yandex_metrika.YandexMetrikaPeriodVisitors)
class jet.dashboard.dashboard_modules.yandex_metrika.YandexMetrikaVisitorsTotals(title=None, period=None, **kwargs)

Yandex Metrika widget that shows total number of visitors, visits and viewers for a particular period of time. Period may be following: Today, Last week, Last month, Last quarter, Last year

period = None

Which period should be displayed. Allowed values - integer of days

class jet.dashboard.dashboard_modules.yandex_metrika.YandexMetrikaVisitorsChart(title=None, period=None, show=None, group=None, **kwargs)

Yandex Metrika widget that shows visitors/visits/viewer chart for a particular period of time. Data is grouped by day, week or month Period may be following: Today, Last week, Last month, Last quarter, Last year

group = None

Sets grouping of data. Possible values: day, week, month

period = None

Which period should be displayed. Allowed values - integer of days

show = None

What data should be shown. Possible values: visitors, visits, page_views

class jet.dashboard.dashboard_modules.yandex_metrika.YandexMetrikaPeriodVisitors(title=None, period=None, group=None, **kwargs)

Yandex Metrika widget that shows visitors, visits and viewers for a particular period of time. Data is grouped by day, week or month Period may be following: Today, Last week, Last month, Last quarter, Last year

group = None

Sets grouping of data. Possible values: day, week, month

period = None

Which period should be displayed. Allowed values - integer of days