• Stars
    star
    333
  • Rank 126,599 (Top 3 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 13 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An improved django-admin-tools dashboard for Django projects

django-fluent-dashboard

The fluent_dashboard module offers a custom admin dashboard, built on top of django-admin-tools (docs).

The django-admin-tools package provides a default mechanism to replace the standard Django admin homepage with a widget based dashboard. The fluent_dashboard module extends this, by providing additional widgets (called "modules") such as:

  • a "icon list" module for the admin homepage.
  • a "welcome" module for the admin homepage.
  • a configurable module layout for the admin homepage, through settings.py.
  • a "return to site" link.
  • an optional "cache statistics" module.

Documentation can be found at: https://django-fluent-dashboard.readthedocs.io/

Screenshot

django-fluent-dashboard preview

Installation

First install the module, preferably in a virtual environment. It can be installed from PyPI:

pip install django-fluent-dashboard

Or the current folder can be installed:

pip install .

Configuration

Add the following settings to settings.py:

INSTALLED_APPS += (
    'fluent_dashboard',

    # enable the admin
    'admin_tools',
    'admin_tools.theming',
    'admin_tools.menu',
    'admin_tools.dashboard',
    'django.contrib.admin',
)

ADMIN_TOOLS_INDEX_DASHBOARD = 'fluent_dashboard.dashboard.FluentIndexDashboard'
ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'fluent_dashboard.dashboard.FluentAppIndexDashboard'
ADMIN_TOOLS_MENU = 'fluent_dashboard.menu.FluentMenu'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': (),
        'OPTIONS': {
            'loaders': (
                ...
                'admin_tools.template_loaders.Loader',  # Add this line!
            ),
        }
    }
]

The admin_tools.theming and admin_tools.menu applications are optional.

Add to urls.py:

urlpatterns += [
    url(r'^admintools/', include('admin_tools.urls')),
]

The database tables for admin_tools can be created afterwards:

./manage.py migrate

Customizing the dashboard

Adding extra icons

The FLUENT_DASHBOARD_APP_ICONS setting is a dictionary that allows you to define extra icons for your own modules, and overwrite default settings. For example:

FLUENT_DASHBOARD_APP_ICONS = {
    'auth/user': "user.png"
}

The icon is expected to be 48x48 pixels. The icon name is treated in 3 different formats:

  • Absolute URLs are passed as-is.
  • Icon names with a / character, are relative to the STATIC_URL.
  • Icon names without any path information, are relative to the current theme folder, e.g. STATIC_URL/fluent_dashboard/themename/

Organizing the application groups

The FLUENT_DASHBOARD_APP_GROUPS setting defines which applications are grouped. For example:

FLUENT_DASHBOARD_APP_GROUPS = (
    (_('CMS'), {
        'models': (
            'cms.*',
            'pages.*',
            'fiber.*',
        ),
        'module': 'CmsAppIconList',
        'collapsible': False,
    }),
    (_('Interactivity'), {
        'models': (
            'django.contrib.comments.*',
            'form_designer.*'
            'threadedcomments.*',
            'zinnia.*',
        ),
    }),
    (_('Administration'), {
        'models': (
            'django.contrib.auth.*',
            'django.contrib.sites.*',
            'google_analytics.*',
            'registration.*',
        ),
    }),
    (_('Applications'), {
        'models': ('*',),
        'module': 'AppList',
        'collapsible': True,
    }),
)

Details about these options, and additional settings are explained in the documentation.

Displaying cache status

This application features optional support for the dashboardmods package, which can display cache statistics. It can be installed using:

pip install dashboardmods

The application requires the cache backends to be configured, for example:

INSTALLED_APPS += (
    'dashboardmods',
)

# Example Memcache configuration:
CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'KEY_PREFIX': 'mysite.production',
        'LOCATION': '127.0.0.1:11211',
        'TIMEOUT': 24*3600,
    },
}

# Optional, example Varnish configuration:
VARNISH_MANAGEMENT_ADDRS = ('127.0.0.1:6082',)

When a cache is not configured, it will simply not be displayed by the module.

Related applications

The following packages provide additional modules, which can be displayed at the dashboard:

  • django-admin-user-stats adds graphs to the dashboard, to see the number of registered users in the last month.
  • django-admin-tools-stats is derived from the previous package, and adds configurable graphs for any model type.
  • dashboardmods is detected to display cache statistics, but also features a configure RSS feed module.
  • django-admin-tools should not be forgotten, because it also provides modules for RSS feeds, link lists and tab grouping.

These modules can be integrated by subclassing the FluentIndexDashboard class, and point to that module with the ADMIN_TOOLS_INDEX_DASHBOARD setting.

Contributing

This module is designed to be generic. In case there is anything you didn't like about it, or think it's not flexible enough, please let us know. We'd love to improve it!

If you have any other valuable contribution, suggestion or idea, please let us know as well because we will look into it. Pull requests are welcome too. :-)

More Repositories

1

django-fluent-comments

A modern, ajax-based appearance for django comments
Python
181
star
2

django-fluent-contents

A widget engine to display various content on Django pages
Python
149
star
3

django-fluent-pages

A flexible, scalable CMS with custom node types, and flexible block content.
Python
109
star
4

django-fluent-blogs

A blog engine with flexible block contents (based on django-fluent-contents)
Python
39
star
5

django-fluent.org

Code of django-fluent.org, also serving as example how to build django-fluent sites.
Python
33
star
6

fluentcms-emailtemplates

An email template system, that uses django-fluent-contents blocks to define the e-mail templates.
Python
4
star
7

demo.django-fluent.org

Demo website for django-fluent
Python
4
star
8

django-fluent-faq

A FAQ engine for Django Fluent CMS
Python
4
star
9

fluentcms-googlemaps

Google Maps widget for django-fluent-contents
Python
3
star
10

fluentcms-cookielaw

Display a dismissable cookie notification | Plugin for django-fluent CMS
Python
3
star
11

fluentcms-contactform

A contact form plugin django-fluent-contents
Python
3
star
12

fluentcms-pager

Bootstrap 3 Pager element for django-fluent-contents
Python
3
star
13

fluentcms-countdown

Countdown timer plugin for django-fluent CMS
Python
3
star
14

fluentcms-teaser

Teaser plugin for django-fluent-contents
Python
2
star
15

django-fluent-utils

Internal utilities for code sharing between django-fluent modules
Python
2
star
16

fluentcms-jumbotron

Bootstrap 3 Jumbotron element for django-fluent-contents
Python
2
star
17

fluentcms-privatenotes

Private sticky notes in the admin of django-fluent-contents
Python
1
star