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.10.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.10-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django3_dash-0.1.10.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.10.tar.gz
Algorithm Hash digest
SHA256 9184d175328a6ee307fe5429a68fff5426cf3389754f925cbfffe570dd7cdf0a
MD5 b3ec4ba26b475448e414caff8ae10204
BLAKE2b-256 5b33f62aa96fa3df42f0189d7abc4cf6d4b974c63690bd2a0bc08056aa67d77d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django3_dash-0.1.10-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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 bb56a33583424de8bc7ac27d77991e28d7f8b0f9ffda5bf1d414382bcb1fdbb6
MD5 02cb4ac7494dbe7813e0982de7f1ac60
BLAKE2b-256 9fd4663e0cdac13e15aebffd9c11ab74a810e6eca34beae7ae16da9493cf283b

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