A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/hypy13/django-daisy below:

hypy13/django-daisy: A modern django dashboard built with daisyui

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.

https://hypy13.github.io/django-daisy-docs/

Stay tuned! Continuous improvements and new features are regularly added to enhance your experience.

Option 1: Install via PyPi 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!

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)
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
    '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
        },
    },
}
Using Tabbed Inline Admin

To create a tabbed inline admin interface in your Django project, follow these steps:

  1. Import the necessary modules: import NavTabMixin in your admin.py file:

    from django_daisy.mixins import NavTabMixin
  2. Extend NavTabMixin in your InlineAdmin class: Create your inline admin class by extending NavTabMixin along with admin.TabularInline or admin.StackedInline for a different layout:

    class ChoiceInline(admin.TabularInline, NavTabMixin):  # or admin.StackedInline for a different layout
        model = Choice
        extra = 1
  3. Register your inline admin class: Use the inline admin class in your ModelAdmin class:

    @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:

  1. Include Django's set_language URL
    Add the following line to your urls.py file:

    urlpatterns = [
        ...,
        path("i18n/", include("django.conf.urls.i18n")),  # Add this line
    ]
  2. Ensure LocaleMiddleware is Enabled
    Confirm that the following middleware is included in your MIDDLEWARE settings:

    MIDDLEWARE = [
        ...,
        'django.middleware.locale.LocaleMiddleware',
        ...
    ]
  3. Define Supported Language
    Specify the languages your application supports in settings.py:

    LANGUAGES = [
        ('en', 'English'),
        ('fa', 'Farsi'),
        # Add other languages as needed
    ]

We welcome contributions from the community! Feel free to submit any issues, suggestions, or pull requests to help improve Django Daisy.

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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4