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: Trueto 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49c24a76787328f14b28402b75baf8642c3ae2ae7df388da78a78acc9d9b52be
|
|
| MD5 |
2961be0aa2e840ff529e30fd7b4a0a5f
|
|
| BLAKE2b-256 |
4f2aaf19ddc08a00a85391de1d7dbccc239f3297527b8ea764696e815d0d21d3
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d98d4de24634fdfe54ea0ff808cf261437bf68566c9ef2f3d3720952afa6b2dc
|
|
| MD5 |
ec515567ef12c1185478da7272c9c073
|
|
| BLAKE2b-256 |
72349c47a4dea1c8a661ac7e8d37f54665ce550e5bd370bb2b7ea2acf65d9f33
|