Skip to main content

A modern Django dashboard built with DaisyUI

Project description

⚙️ Compatibility

  • Django: 3.2 - 5.1.1 fully supported
  • Python: 3.8+

📦 Installation

Quick Install (PyPI)

pip install django3-dash

Configuration

Add to your INSTALLED_APPS in settings.py:

INSTALLED_APPS = [
    'django_dash',
    'django.contrib.admin',
    'django.contrib.humanize',  # Required
    # ... your other apps
]

That's it! Your admin now has a modern, beautiful interface.


🎨 Customization

App Configuration (apps.py)

Customize individual app appearance in the sidebar:

class PollsConfig(AppConfig):
    name = 'polls'
    icon = 'fa fa-square-poll-vertical'  # FontAwesome icon
    divider_title = "Apps"  # Section divider title
    priority = 0  # Sidebar ordering (higher = top)
    hide = False  # Hide from sidebar
Global Settings (settings.py)

Configure site-wide appearance and behavior:

DASH_SETTINGS = {
    # Branding
    'SITE_TITLE': 'Django Admin',
    'SITE_HEADER': 'Administration',
    'INDEX_TITLE': 'Hi, welcome to your dashboard',
    'SITE_LOGO': '/static/admin/img/daisyui-logomark.svg',
    
    # Customization
    'EXTRA_STYLES': [],  # Additional CSS files
    'EXTRA_SCRIPTS': [],  # Additional JS files
    'LOAD_FULL_STYLES': False,  # Load complete DaisyUI library
    'SHOW_CHANGELIST_FILTER': False,  # Auto-open filter sidebar
    'DONT_SUPPORT_ME': False,  # Hide GitHub link
    'SIDEBAR_FOOTNOTE': '',  # Custom sidebar footer text
    
    # Theme Configuration
    'DEFAULT_THEME': None,  # e.g., 'corporate', 'dark'
    'DEFAULT_THEME_DARK': None,  # Dark mode default
    'SHOW_THEME_SELECTOR': True,  # Show/hide theme dropdown
    'THEME_LIST': [
        {'name': 'Light', 'value': 'light'},
        {'name': 'Dark', 'value': 'dark'},
        # Add custom themes...
    ],
    
    # Third-Party App Customization
    'APPS_REORDER': {
        'auth': {
            'icon': 'fa-solid fa-person-military-pointing',
            'name': 'Authentication',
            'hide': False,
            'divider_title': "Auth",
        },
    },
}
Theme Configuration Examples

Single Default Theme:

DASH_SETTINGS = {
    'DEFAULT_THEME': 'corporate',  # Always use this theme
}

Separate Light/Dark Themes:

DASH_SETTINGS = {
    'DEFAULT_THEME': 'light',      # Light mode default
    'DEFAULT_THEME_DARK': 'dim',   # Dark mode default
}

Enforce Theme (No User Choice):

DASH_SETTINGS = {
    'DEFAULT_THEME': 'corporate',
    'SHOW_THEME_SELECTOR': False,  # Hide selector
}

Custom Theme List:

DASH_SETTINGS = {
    'THEME_LIST': [
        {'name': 'Light', 'value': 'light'},
        {'name': 'Corporate', 'value': 'corporate'},
        {'name': 'Luxury', 'value': 'luxury'},
    ],
}

Note: For custom DaisyUI themes, enable LOAD_FULL_STYLES: True to load all theme styles.


🔧 Advanced Features

Tabbed Inline Admin

Create tabbed inline interfaces for related objects:

from django_dash.mixins import NavTabMixin

class ChoiceInline(admin.TabularInline, NavTabMixin):
    model = Choice
    extra = 1

@admin.register(Poll)
class PollAdmin(admin.ModelAdmin):
    inlines = [ChoiceInline]
Tabbed Fieldsets

Convert fieldsets into navigation tabs:

@admin.register(MyModel)
class MyModelAdmin(admin.ModelAdmin):
    fieldsets = (
        (None, {
            'fields': ('username', 'password')
        }),
        ('Personal Info', {
            'fields': ('first_name', 'last_name', 'email'),
            'classes': ('navtab',),  # Creates a tab
        }),
        ('Permissions', {
            'fields': ('is_active', 'is_staff', 'is_superuser'),
        }),
    )
Language Switching

Enable language selection in the admin panel:

1. Add URL pattern (urls.py):

urlpatterns = [
    path("i18n/", include("django.conf.urls.i18n")),
    # ... other patterns
]

2. Enable middleware (settings.py):

MIDDLEWARE = [
    'django.middleware.locale.LocaleMiddleware',
    # ... other middleware
]

3. Define languages (settings.py):

LANGUAGES = [
    ('en', 'English'),
    ('fa', 'Farsi'),
    # Add more languages...
]

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

django3_dash-0.1.6.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django3_dash-0.1.6-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

File details

Details for the file django3_dash-0.1.6.tar.gz.

File metadata

  • Download URL: django3_dash-0.1.6.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for django3_dash-0.1.6.tar.gz
Algorithm Hash digest
SHA256 43493c34418c9dc5734ace74abae091f79ca1e849e8b21f32ec7b4b402eaf858
MD5 8c517c5856276a1f1360517f43498902
BLAKE2b-256 e75518a265356b18362b0f1d581c2f67daef94f5347b104942fdc469223e556d

See more details on using hashes here.

File details

Details for the file django3_dash-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: django3_dash-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for django3_dash-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 58a926954baa07f05d5cbbcba2b7739aaf8df945ab71a66772f13a3177f788ba
MD5 432cb50a80235d3cffca758938f4e36d
BLAKE2b-256 a01d564f8dbb10ab7f760130beea9d6ec31ec84a61fcb0a2645bdea79c775f79

See more details on using hashes here.

Supported by

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