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.5.tar.gz (2.5 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.5-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django3_dash-0.1.5.tar.gz
  • Upload date:
  • Size: 2.5 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.5.tar.gz
Algorithm Hash digest
SHA256 5919dc98b7b067ff098a3b690da2f0b7c362d2900ddb5051257315e2c0ec2c81
MD5 774666efe6aa4a106b02289bd1fb92c1
BLAKE2b-256 4577c5ec571c5c32cdca160205e27c56de8ed17cef4e4eaa5a8eddece89096b5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django3_dash-0.1.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7e772f115268b2523ddcee7ea101d8491fd54a7f29605daa64dfdb64e769d85b
MD5 08263084c9dcdb953d5380e2377b9072
BLAKE2b-256 95ccfed95626eaa690863cb1e8f28be3d701e7b4e3ef5fda9be1268cb2c475e5

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