Skip to content

Integrate django-unfold for enhanced admin interface#31

Merged
jonocodes merged 3 commits intomainfrom
claude/update-django-unfold-admin-S0qgY
Feb 22, 2026
Merged

Integrate django-unfold for enhanced admin interface#31
jonocodes merged 3 commits intomainfrom
claude/update-django-unfold-admin-S0qgY

Conversation

@jonocodes
Copy link
Owner

Summary

This PR integrates django-unfold, a modern admin interface package, to replace the custom admin navigation template with a more feature-rich and maintainable solution.

Key Changes

  • Added django-unfold dependency to requirements.txt
  • Installed unfold app in INSTALLED_APPS (before django.contrib.admin as required)
  • Configured UNFOLD settings with:
    • Site branding (title and header)
    • Custom sidebar navigation with Tools and Administration sections
    • Quick links to key admin functions (Add URL, Grid View, List View, Bookmarklet, Feed Links, About, Site Home)
    • Media Items administration link
  • Removed custom admin template (media/templates/admin/nav_sidebar.html) - functionality now handled by unfold configuration
  • Updated MediaItemAdmin to inherit from UnfoldModelAdmin instead of admin.ModelAdmin for unfold styling
  • Simplified admin site configuration in urls.py (removed verbose titles, now managed by unfold settings)
  • Minor code formatting improvements in create_test_user.py management command

Implementation Details

The unfold package provides a modern, responsive admin interface while maintaining Django's admin functionality. The custom navigation that was previously defined in nav_sidebar.html is now declaratively configured in settings.py, making it easier to maintain and extend. The sidebar configuration includes Material Design icons for better visual organization.

https://claude.ai/code/session_01CNDDDkyzGqiqbrbPNynnYU

Replace the default Django admin with django-unfold for a modern UI with
Tailwind CSS styling, dark mode support, and Material Symbols icons.

Changes:
- Add django-unfold to requirements.txt
- Add 'unfold' to INSTALLED_APPS (before django.contrib.admin)
- Configure UNFOLD settings with sidebar navigation for custom tools
- Switch MediaItemAdmin to inherit from unfold.admin.ModelAdmin
- Remove custom nav_sidebar.html (replaced by Unfold's sidebar config)
- Simplify admin site header/title in urls.py

https://claude.ai/code/session_01CNDDDkyzGqiqbrbPNynnYU
Unfold toggles a .dark class on <html> for dark mode, but all custom
admin templates had hardcoded light-mode colors. Add .dark CSS variable
overrides so backgrounds, text, borders, and surfaces adapt to the
active theme.

Changes across all 10 templates:
- Add .dark {} block overriding --sc-* CSS variables with dark palette
- Convert grid_view, list_view, item_detail from Django admin vars
  (--body-bg, --body-fg, etc.) to the --sc-* variable system
- Replace hardcoded solid status badge colors in item_detail with
  color-mix(transparent) for theme-safe rendering
- Fix code block backgrounds (rgba(0,0,0,0.1) -> var(--sc-surface))
- Fix bookmarklet button colors to use theme variables
- Fix selected result background in spotify confirm to use --sc-primary

https://claude.ai/code/session_01CNDDDkyzGqiqbrbPNynnYU
@jonocodes jonocodes force-pushed the claude/update-django-unfold-admin-S0qgY branch from 4571d87 to 82209d1 Compare February 22, 2026 14:03
@jonocodes jonocodes merged commit 3e66866 into main Feb 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants