A modern Django dashboard built with DaisyUI
Project description
Django Daisy
Live Demo https://hypy13-django-daisy.hf.space/en/admin/
Username: demo
Password: demo
for RTL mode: https://hypy13-django-daisy.hf.space/fa/admin/
Django Daisy is a modern, sleek, and highly responsive admin dashboard built with DaisyUI and TailwindCSS. It brings a polished and user-friendly interface that scales beautifully across devices, from mobile to desktop, making your admin experience fast and efficient.
Documentation:
https://hypy13.github.io/django-daisy-docs/
✨ Key Features
- 🌍 Responsive Design: Perfectly adapts to all screen sizes, ensuring a seamless user experience across mobile, tablet, and desktop devices.
- 🔄 RTL Support: Complete right-to-left language support, with a clean and consistent layout for RTL users.
- 🎨 Multi-Theme Support: Effortlessly switch between themes to match your brand identity or personal style.
- 🚀 Enhanced UX/UI: Experience an optimized interface with tabbed inline admin panels for better organization and usability.
- 📝 Tabbed Inline Admin: Manage related data more efficiently with tabbed inline admin sections, improving organization and accessibility.
- 🔍 Advanced Admin Filtering: Utilize multi-value filters for fast and precise navigation through admin lists.
⚙️ Compatibility
- Django 3.2 - 5.1.1 are fully supported.
🚧 Upcoming Features
Stay tuned! Continuous improvements and new features are regularly added to enhance your experience.
📦 Installation
Option 1: Install via PyPi
pip install django-daisy
Option 2: Install as an editable GitHub source
pip install -e git+https://github.com/hypy13/django-daisy.git#egg=django-daisy
After installation, add django_daisy and django.contrib.humanize to your INSTALLED_APPS in the Django settings file.
INSTALLED_APPS = [
'django_daisy',
'django.contrib.admin',
'django.contrib.humanize', # Required for django-daisy
...
]
Once you've made these changes, enjoy the fresh new theme!
Project Customizations
1. App Configuration in apps.py
You can configure app-specific settings in the apps.py file for each application within your Django project. Below is an example of how to customize the Polls app:
class PollsConfig(AppConfig):
name = 'polls' # The name of the app
icon = 'fa fa-square-poll-vertical' # FontAwesome icon for the app (optional)
divider_title = "Apps" # Title of the section divider in the sidebar (optional)
priority = 0 # Determines the order of the app in the sidebar (higher values appear first, optional)
hide = False # Set to True to hide the app from the sidebar menu (optional)
Explanation:
- name: The name of the app.
- icon: An optional FontAwesome icon to display next to the app name in the sidebar.
- divider_title: The title for the section divider, grouping similar apps together (optional).
- priority: An optional setting that controls the order of apps in the sidebar; higher values appear at the top.
- hide: If set to
True, the app will be hidden from the sidebar menu.
2. Global Customizations in settings.py
You can define various project-wide settings for customizing the Django admin interface in your settings.py file using the DAISY_SETTINGS dictionary. Below is an example configuration:
DAISY_SETTINGS = {
'SITE_TITLE': 'Django Admin', # The title of the site
'SITE_HEADER': 'Administration', # Header text displayed in the admin panel
'INDEX_TITLE': 'Hi, welcome to your dashboard', # The title for the index page of dashboard
'SITE_LOGO': '/static/admin/img/daisyui-logomark.svg', # Path to the logo image displayed in the sidebar
'EXTRA_STYLES': [], # List of extra stylesheets to be loaded in base.html (optional)
'EXTRA_SCRIPTS': [], # List of extra script URLs to be loaded in base.html (optional)
'LOAD_FULL_STYLES': False, # If True, loads full DaisyUI components in the admin (useful if you have custom template overrides)
'SHOW_CHANGELIST_FILTER': False, # If True, the filter sidebar will open by default on changelist views
'DONT_SUPPORT_ME': False, # Hide github link in sidebar footer
'SIDEBAR_FOOTNOTE': '', # add footnote to sidebar
'DEFAULT_THEME': None, # Set a default theme (e.g., 'corporate', 'dark', 'light')
'DEFAULT_THEME_DARK': None, # Set a default dark theme when system prefers dark mode
'SHOW_THEME_SELECTOR': True, # If False, hides the theme selector dropdown entirely
'THEME_LIST': [ # List of themes shown in the theme selector dropdown
{'name': 'Light', 'value': 'light'},
{'name': 'Dark', 'value': 'dark'},
# ... customize as needed
],
'APPS_REORDER': {
# Custom configurations for third-party apps that can't be modified directly in their `apps.py`
'auth': {
'icon': 'fa-solid fa-person-military-pointing', # FontAwesome icon for the 'auth' app
'name': 'Authentication', # Custom name for the 'auth' app
'hide': False, # Whether to hide the 'auth' app from the sidebar (set to True to hide)
'divider_title': "Auth", # Divider title for the 'auth' section
},
'social_django': {
'icon': 'fa-solid fa-users-gear', # Custom FontAwesome icon for the 'social_django' app
},
},
}
Explanation:
- SITE_TITLE: Sets the title of your site (visible in the browser tab).
- SITE_HEADER: The header displayed at the top of the Django admin interface.
- INDEX_TITLE: The title shown on the dashboard page of the admin panel.
- SITE_LOGO: Specifies the path to a logo image that appears in the sidebar.
- EXTRA_STYLES: A list of additional CSS files to be loaded into the admin interface (useful for custom styling).
- EXTRA_SCRIPTS: A list of additional JavaScript files to be loaded into the admin interface.
- LOAD_FULL_STYLES: If set to
True, loads the full DaisyUI library for styling, which can be useful if you have overridden the admin templates. - SHOW_CHANGELIST_FILTER: Controls whether the changelist filter sidebar is shown by default.
- DONT_SUPPORT_ME: Hide github link in sidebar footer.
- SIDEBAR_FOOTNOTE: Add footnote to sidebar.
- DEFAULT_THEME: Sets a default theme for all users (e.g., 'corporate', 'dark', 'light'). If set alone, this theme will always be used as the default regardless of system preference.
- DEFAULT_THEME_DARK: Sets a default theme when the system prefers dark mode. Only used when
DEFAULT_THEMEis also set. When both are configured, the appropriate theme is chosen based on the user's system color scheme preference. - SHOW_THEME_SELECTOR: Controls whether the theme selector dropdown is visible in the navbar. Set to
Falseto hide the theme selector entirely, useful when enforcing a specific theme organization-wide. - THEME_LIST: Configures which themes appear in the theme selector dropdown. Each theme should have a
name(display text) andvalue(theme ID). Defaults to six popular DaisyUI themes. - APPS_REORDER: This allows you to reorder, customize, and modify third-party apps. For example, you can change the name of the
authapp tousers, provide a custom icon, or hide it from the sidebar entirely.
Theme Configuration Examples
Single Default Theme
To set one theme as default for all users regardless of their system preference:
DAISY_SETTINGS = {
'DEFAULT_THEME': 'corporate', # Always use corporate theme
# ... other settings
}
Separate Light/Dark Default Themes
To set different default themes based on system color scheme preference:
DAISY_SETTINGS = {
'DEFAULT_THEME': 'light', # Default for light mode
'DEFAULT_THEME_DARK': 'dim', # Default for dark mode
# ... other settings
}
Enforce Theme Without User Choice
To completely hide the theme selector and enforce a specific theme:
DAISY_SETTINGS = {
'DEFAULT_THEME': 'corporate', # Enforced theme
'SHOW_THEME_SELECTOR': False, # Hide theme selector
# ... other settings
}
Custom Theme List
To customize which themes appear in the dropdown selector:
DAISY_SETTINGS = {
'DEFAULT_THEME': 'corporate',
'THEME_LIST': [
{'name': 'Light', 'value': 'light'},
{'name': 'Corporate', 'value': 'corporate'},
{'name': 'Business', 'value': 'business'},
{'name': 'Luxury', 'value': 'luxury'},
],
# ... other settings
}
Note: The theme selection logic prioritizes user-saved preferences in localStorage first, then falls back to your configured defaults, and finally to system preference if no defaults are set.
Important: When using custom DaisyUI themes (like 'corporate', 'dim', 'autumn', etc.) as default themes, you may need to enable LOAD_FULL_STYLES: True to ensure all theme styles are loaded properly.
Using Tabbed Inline Admin
To create a tabbed inline admin interface in your Django project, follow these steps:
-
Import the necessary modules: import NavTabMixin in your
admin.pyfile:from django_daisy.mixins import NavTabMixin
-
Extend
NavTabMixinin yourInlineAdminclass: Create your inline admin class by extendingNavTabMixinalong withadmin.TabularInlineoradmin.StackedInlinefor a different layout:class ChoiceInline(admin.TabularInline, NavTabMixin): # or admin.StackedInline for a different layout model = Choice extra = 1
-
Register your inline admin class: Use the inline admin class in your
ModelAdminclass:@admin.register(Poll) class PollAdmin(admin.ModelAdmin): inlines = [ChoiceInline]
Making Admin Fieldsets as Navtabs
To make admin fieldsets appear as navigation tabs in the admin interface, add the navtab class to the classes attribute of your fieldset definition in your admin.py file:
@admin.register(MyModel)
class MyModelAdmin(admin.ModelAdmin):
fieldsets = (
(None, {
'fields': ('username', 'password')
}),
(_('Personal info (tabbed example)'), {
'fields': (
'first_name', 'last_name', 'email',
),
'classes': ('navtab',), # Add navtab class here
}),
(_('No tabbed example'), {
'fields': (
'is_active', 'is_staff', 'is_superuser',
),
}),
)
This will create a tabbed interface where each fieldset marked with the navtab class appears as a separate navigation tab in the admin form.
🌐 Enabling Language Change in Admin Panel
To enable language switching directly from the admin panel, follow these steps:
-
Include Django's
set_languageURL
Add the following line to yoururls.pyfile:urlpatterns = [ ..., path("i18n/", include("django.conf.urls.i18n")), # Add this line ]
-
Ensure
LocaleMiddlewareis Enabled
Confirm that the following middleware is included in yourMIDDLEWAREsettings:MIDDLEWARE = [ ..., 'django.middleware.locale.LocaleMiddleware', ... ]
-
Define Supported Language
Specify the languages your application supports insettings.py:LANGUAGES = [ ('en', 'English'), ('fa', 'Farsi'), # Add other languages as needed ]
🤝 Contributing
We welcome contributions from the community! Feel free to submit any issues, suggestions, or pull requests to help improve Django Daisy.
📸 Screenshots
Listing View:
Change Form:
Mobile Responsive:
Dark Theme:
Acknowledgments
Special thanks to Cloud With Django for featuring my theme in their video. Your support means a lot!
Demo Video: https://www.youtube.com/watch?v=WEKTXu1la9M
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 django_daisy-1.1.1.tar.gz.
File metadata
- Download URL: django_daisy-1.1.1.tar.gz
- Upload date:
- Size: 2.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96caa16e050d1f50e13947ec090e3562fad974cb6ac69aab90a4fb14c6e426fb
|
|
| MD5 |
560da240c1eec01e41aa60e42297a7a6
|
|
| BLAKE2b-256 |
813f108a0c62f881187b06a3c28ede8b79002d21124978a9ee8cc5e7227f7090
|
File details
Details for the file django_daisy-1.1.1-py3-none-any.whl.
File metadata
- Download URL: django_daisy-1.1.1-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.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ad7fbe5197b5d50343e12675cf51f22e07d78f1a357617addeb804dd7ffa517
|
|
| MD5 |
d7a87ad77a6c6d146d5ce4818dd7f3b4
|
|
| BLAKE2b-256 |
328b0eff561fecf4c26ce3756d94ea0f16e9afeab78d377f9377906d3a95d8d7
|