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

Uploaded Python 3

File details

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

File metadata

  • Download URL: django3_dash-0.1.9.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.9.tar.gz
Algorithm Hash digest
SHA256 49c24a76787328f14b28402b75baf8642c3ae2ae7df388da78a78acc9d9b52be
MD5 2961be0aa2e840ff529e30fd7b4a0a5f
BLAKE2b-256 4f2aaf19ddc08a00a85391de1d7dbccc239f3297527b8ea764696e815d0d21d3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django3_dash-0.1.9-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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 d98d4de24634fdfe54ea0ff808cf261437bf68566c9ef2f3d3720952afa6b2dc
MD5 ec515567ef12c1185478da7272c9c073
BLAKE2b-256 72349c47a4dea1c8a661ac7e8d37f54665ce550e5bd370bb2b7ea2acf65d9f33

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