Skip to main content

An improved django-admin-tools dashboard for Django projects

Project description

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'

Note that some admin_tools applications are optional, yet recommended to have the full experience of the module.

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.

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. :-)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-fluent-dashboard-1.0.tar.gz (376.7 kB view details)

Uploaded Source

Built Distributions

django_fluent_dashboard-1.0-py3-none-any.whl (421.6 kB view details)

Uploaded Python 3

django_fluent_dashboard-1.0-py2.py3-none-any.whl (421.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-fluent-dashboard-1.0.tar.gz.

File metadata

File hashes

Hashes for django-fluent-dashboard-1.0.tar.gz
Algorithm Hash digest
SHA256 3b701bb72b2989080885cd859778ad5f8781401ea1caeeb2730b8b2ca472d23c
MD5 548816d182448597de5fdce8b85fe763
BLAKE2b-256 33cf78bca520965bf1abbdefb3edfe46eacba43289541ebfb6b52fce896c2047

See more details on using hashes here.

File details

Details for the file django_fluent_dashboard-1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_fluent_dashboard-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba99e9d8814717fbc7cec2dac12ad1a5b1d18c18e356d26b580472270af0849e
MD5 3ca926dab773d0247076673d658453b2
BLAKE2b-256 26f5cece548463cd902d5ab5547ca986da8361b40d7a921099d107f62d32fa3a

See more details on using hashes here.

File details

Details for the file django_fluent_dashboard-1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_fluent_dashboard-1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 80360f03cbdf61240a6e7b67537ec6015e8b20211d12afc0847759c87b52e2a0
MD5 f6ef5b8e585248d8f18eb28cc5d83332
BLAKE2b-256 ab9ad0cd8ce877cfd26a1dfca79fadc1da2af14332e1e1134f905d87641945f6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page