Skip to main content 홈 크리에이터 mte90 dotfiles django-unfold
django-unfold Modern Django admin theme - Unfold - customization, settings, components, actions, filters, integrations
설치로 이동 Skills Marketplace 커뮤니티가 만든 AI 스킬을 발견하고 탐색하세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/Mte90/dotfiles --skill django-unfold명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Zip 다운로드 다운로드 중...
name django-unfold description Modern Django admin theme - Unfold - customization, settings, components, actions, filters, integrations metadata {"author":"mte90","version":"1.1.0","based_on":"https://github.com/unfoldadmin/django-unfold","tags":["python","django","admin","unfold","theme","dashboard"]}
Django Unfold
Modern Django admin theme with beautiful design and advanced features.
Overview
Unfold is a modern theme for Django admin that provides:
Versions : django-unfold 0.76.x + Django 6.0 fully compatible.
Beautiful design - Modern UI with Tailwind CSS
Dark mode - Built-in dark theme support
Custom components - Charts, tables, cards, buttons
Easy customization - Settings, branding, sidebar
Integrations - Works with django-celery-beat, django-import-export, etc.
Installation
pip install django-unfold
pip install django-unfold==0.9.0
INSTALLED_APPS = [
'unfold' ,
'django.contrib.admin' ,
'django.contrib.auth' ,
'django.contrib.contenttypes' ,
'django.contrib.sessions' ,
'django.contrib.messages' ,
]
UNFOLD = {
}
Important : unfold must be first in INSTALLED_APPS to override Django templates.
Quick Start
Basic Configuration
INSTALLED_APPS = [
'unfold' ,
'django.contrib.admin' ,
'django.contrib.auth' ,
'django.contrib.contenttypes' ,
'django.contrib.sessions' ,
'django.contrib.messages' ,
]
URL Configuration Unfold doesn't require changes to your URL configuration:
from django.urls import path, include
urlpatterns = [
path('admin/' , admin.site.urls),
]
Settings Reference
Site Branding UNFOLD = {
'SITE_HEADER' : 'My Company Admin' ,
'SITE_TITLE' : 'My Admin' ,
'INDEX_TITLE' : 'Welcome to Dashboard' ,
'SITE_HEADER' : '<div class="flex items-center gap-2"><span>🚀</span> My Company</div>' ,
}
Colors and Theme UNFOLD = {
'COLORS' : {
'primary' : {
'50' : '239 246 255' ,
'100' : '219 234 254' ,
'200' : '191 219 254' ,
'300' : '147 197 253' ,
'400' : '96 165 250' ,
'500' : '59 130 246' ,
'600' : '37 99 235' ,
'700' : '29 78 216' ,
'800' : '30 64 175' ,
'900' : '30 58 138' ,
'950' : '30 58 138' ,
},
},
'DARK_MODE_COLORS' : {
'primary' : {
'50' : '239 246 255' ,
},
},
}
Sidebar Navigation UNFOLD = {
'SIDEBAR' : {
'show_search' : True ,
'navigation' : [
{
'title' : 'Main' ,
'items' : [
{'title' : 'Dashboard' , 'icon' : 'dashboard' , 'link' : '/admin/' },
{'title' : 'Users' , 'icon' : 'people' , 'link' : '/admin/auth/user/' },
],
},
{
'title' : 'Content' ,
'items' : [
{'title' : 'Articles' , 'icon' : 'article' , 'link' : '/admin/myapp/article/' },
],
},
],
},
}
Dashboard Widgets UNFOLD = {
'DASHBOARD_WIDGETS' : [
'unfold.widgets.DashboardStatistics' ,
'unfold.widgets.DashboardActions' ,
],
}
Feature Flags UNFOLD = {
'SHOW_HISTORY' : True ,
'SHOW_VIEW_ON_SITE' : True ,
'AUTH_PASSWORD_VALIDATION' : True ,
}
Custom Admin Site
Custom Site Class
from unfold.admin import ModelAdmin, UnfoldAdminSite
from django.contrib.admin import AdminSite
class CustomAdminSite (UnfoldAdminSite ):
site_header = 'My Custom Admin'
site_title = 'My Admin Panel'
index_title = 'Welcome to Management'
def each_context (self, request ):
context = super ().each_context(request)
context['custom_data' ] = 'value'
return context
admin_site = CustomAdminSite(name='myadmin' )
UNFOLD_ADMIN_SITE_CLASS = 'myapp.admin.CustomAdminSite'
Custom ModelAdmin
from django.contrib import admin
from unfold.admin import ModelAdmin
from .models import Article
@admin.register(Article, site=custom_admin_site )
class ArticleAdmin (ModelAdmin ):
list_display = ['title' , 'status' , 'created_at' ]
search_fields = ['title' , 'content' ]
list_filter = ['status' , 'created_at' ]
sidebar_fieldsets = (
(None , {'fields' : ('title' , 'slug' )}),
('Content' , {'fields' : ('content' , 'excerpt' )}),
)
Components
Buttons from unfold.decorators import action
from unfold.actions import Actions
class ArticleAdmin (ModelAdmin ):
@action(description='Publish selected' )
def make_published (self, request, queryset ):
queryset.update(status='published' )
@action(description='Export to CSV' )
def export_csv (self, request, queryset ):
pass
@display Decorator (Django 6.0+) from unfold.decorators import display
class UserAdmin (ModelAdmin ):
@display(description="Status" , boolean=True )
def is_active (self, obj ):
return obj.is_active
@display(description="Actions" , order="username" )
def user_actions (self, obj ):
return f"{obj.first_name} {obj.last_name} "
Cards
{% load unfold %}
{% component "card" title="Statistics" %}
<div class ="p-4" >
<p class ="text-2xl font-bold" >1 ,234 </p>
<p class ="text-gray-500" >Total Users</p>
</div>
{% endcomponent %}
Charts
{% component "chart" type ="line" data=chart_data %}
{% endcomponent %}
Tables
class UserAdmin (ModelAdmin ):
list_display = ['username' , 'email' , 'status_badge' ]
@bind_to(admin_order_field='is_active' )
def status_badge (self, obj ):
from unfold.helpers import icon
if obj.is_active:
return icon('check_circle' , classes='text-green-500' )
return icon('x_circle' , classes='text-red-500' )
Fields and Widgets
Autocomplete Fields from unfold import fields
from unfold.forms import ModelForm
class ArticleForm (ModelForm ):
class Meta :
model = Article
fields = '__all__'
author = fields.AutocompleteField(
queryset=User.objects.all (),
search_fields=['username' , 'email' ],
label='Author'
)
JSON Fields from unfold.fields import JSONField
class ConfigAdmin (ModelAdmin ):
fieldsets = (
(None , {
'fields' : ('config_json' ,)
}),
)
def get_form (self, request, obj=None , **kwargs ):
form = super ().get_form(request, obj, **kwargs)
form.base_fields['config_json' ] = fields.JSONField(
widget=forms.Textarea(attrs={
'class' : 'font-mono text-sm' ,
'rows' : 10
})
)
return form
Filters
Custom Filters import unfold.filters as filters
class ArticleAdmin (ModelAdmin ):
list_filter = [
('status' , filters.DropdownFilter),
('category' , filters.DropdownFilter),
('created_at' , filters.DateRangeFilter),
('author' , filters.AutocompleteFilter),
]
Filter Types
('status' , filters.DropdownFilter)
('created_at' , filters.DateRangeFilter)
('author' , filters.AutocompleteFilter)
('is_published' , filters.CheckboxFilter)
('views' , filters.NumericFilter)
('title' , filters.TextFilter)
Actions
Custom Actions from django.http import HttpResponse
from django.shortcuts import render
import csv
import io
class ArticleAdmin (ModelAdmin ):
@action(description='Export selected to CSV' )
def export_csv (self, request, queryset ):
buffer = io.StringIO()
writer = csv.writer(buffer)
writer.writerow(['Title' , 'Status' , 'Created' ])
for obj in queryset:
writer.writerow([obj.title, obj.status, obj.created])
response = HttpResponse(buffer.getvalue(), content_type='text/csv' )
response['Content-Disposition' ] = 'attachment; filename="articles.csv"'
return response
@action(description='Send to publication' )
def publish (self, request, queryset ):
queryset.update(status='published' , published_at=timezone.now())
publish.short_description = 'Publish selected articles'
Row Actions class ArticleAdmin (ModelAdmin ):
def get_row_actions (self, obj ):
actions = super ().get_row_actions(obj)
actions.append(
actions.Link(
'preview' ,
icon='visibility' ,
link=f'/admin/myapp/article/{obj.pk} /preview/'
)
)
return actions
Tabs
Using Tabs class ArticleAdmin (ModelAdmin ):
tabs = [
{'title' : 'Content' , 'id' : 'content' },
{'title' : 'SEO' , 'id' : 'seo' },
{'title' : 'Metadata' , 'id' : 'metadata' },
]
fieldsets = (
(None , {
'fields' : ('title' , 'content' ),
'tab_id' : 'content' ,
}),
('SEO Settings' , {
'fields' : ('meta_title' , 'meta_description' ),
'tab_id' : 'seo' ,
}),
('Metadata' , {
'fields' : ('created_at' , 'updated_at' ),
'tab_id' : 'metadata' ,
}),
)
Integrations
django-guardian (Object Permissions)
pip install django-guardian
INSTALLED_APPS = [
'guardian' ,
'unfold' ,
'django.contrib.admin' ,
]
from django.contrib import admin
from unfold.contrib.guardian.admin import GuardedModelAdmin
class ArticleAdmin (GuardedModelAdmin ):
pass
django-import-export pip install django-import -export
from import_export import resources
from unfold.admin import ImportExportMixin
class ArticleResource (resources.ModelResource):
class Meta :
model = Article
fields = ('id' , 'title' , 'status' , 'created_at' )
class ArticleAdmin (ImportExportMixin, ModelAdmin):
resource_classes = [ArticleResource]
django-celery-beat
pip install django-celery-beat
django-constance pip install django-constance[database]
INSTALLED_APPS = [
'constance' ,
'unfold' ,
]
Authentication Customization
Custom Login Form
from django import forms
from unfold.forms import LoginForm
class CustomLoginForm (LoginForm ):
def clean (self ):
cleaned_data = super ().clean()
return cleaned_data
UNFOLD = {
'LOGIN' : {
'form' : 'myapp.forms.CustomLoginForm' ,
},
}
Custom Views
UNFOLD = {
'PASSWORD_CHANGE_FORM' : 'myapp.forms.CustomPasswordChangeForm' ,
'PASSWORD_RESET_FORM' : 'myapp.forms.CustomPasswordResetForm' ,
}
Dark Mode
Automatic Dark Mode Unfold automatically supports dark mode based on system preference.
Manual Control
UNFOLD = {
'THEME' : 'dark' ,
}
Custom Colors for Dark Mode UNFOLD = {
'DARK_MODE_COLORS' : {
'primary' : {
'50' : '224 242 254' ,
'100' : '214 238 253' ,
},
},
}
Custom Styling
Custom CSS
UNFOLD = {
'STYLES' : [
'css/custom.css' ,
],
}
{% extends "admin/base.html" %}
{% load static %}
{% block extrastyle %}
<link rel="stylesheet" href="{% static 'css/custom.css' %}" >
{% endblock %}
Custom JavaScript UNFOLD = {
'SCRIPTS' : [
'js/custom.js' ,
],
}
Best Practices
Keep unfold first in INSTALLED_APPS
Use Unfold ModelAdmin for all models
Leverage tabs for organized forms
Use filters for better list navigation
Customize actions for bulk operations
Enable dark mode - users love it
Use integrations - they work out of the box
Ecosystem Libraries
django-unfold-modal Replaces Django admin's popup windows for related objects (ForeignKey, ManyToMany, etc.) with Unfold-styled modals, so related-object selection happens in-page instead of in separate browser windows.
Modal replacement for admin related-object popups (ForeignKey/ManyToMany/OneToOne selects, raw_id_fields lookup, autocomplete_fields/Select2, related fields inside inlines)
Nested modals with replace/restore behavior
Size presets (default/large/full) and optional manual resize handle
Optional admin header suppression inside modal iframes
Django CMS integration — admin modals can open in the CMS parent window when admin runs inside a CMS modal
pip install django-unfold-modal
django-unfold-markdown Markdown editor widget for the Django Unfold admin: a plain-text monospace editor with live preview that renders stored content as Markdown.
Plain text editor with monospace font (no rich-text WYSIWYG)
Side-by-side live preview and fullscreen mode
Dark/light theme integration with Unfold; Material Symbols icons matching Unfold design
Toolbar: bold, italic, strikethrough, headings, lists, links, images, tables, horizontal rule
No autosave — content saves on form submit
Responsive layout; renders stored text with markdown or mistune
pip install django-unfold-markdown
django-unfold-extra Unofficial "extra" package that enhances the Django Unfold admin interface with Unfold-styled integrations for Django CMS 5.0, django-parler multilingual models, and django-versatileimagefield.
Django CMS 5.0 integration: Unfold-styled page tree with "New Page" button and language switcher, tabbed Page/PageContent change forms, PageUser/PageUserGroup/GlobalPagePermission admin with permission inlines, djangocms-versioning admin
UnfoldCMSPluginBase with UnfoldStackedInline/UnfoldTabularInline; drop-in Unfold-styled djangocms-link Link plugin and djangocms-alias admin
django-parler support: UnfoldTranslatableAdminMixin, UnfoldTranslatableStackedAdminMixin, UnfoldTranslatableTabularAdminMixin, translatable inlines
django-versatileimagefield integration (preview + ppoi)
Unfold auto-update of styles from the official package via npm; Theme-Sync to control themes from either the Unfold or CMS switcher
pip install django-unfold-extra
Note: Used in production but the author notes to "expect additional implementation work"; recommended mainly when most CMS plugins are custom-built.
django-admin-action-forms Django admin extension that adds confirmation pages for admin actions: each action can have a custom form shown on an intermediate page before execution, with the form data passed to the action as an extra argument. Works with the stock Django admin (not Unfold-specific, but pairs well with Unfold's admin theming).
@action_with_form decorator + ActionForm base class; form data passed to the action as an additional argument
Supports Django 3.2.x through 6.x.x; no additional dependencies
Supports fields/fieldsets, filter_horizontal/filter_vertical, autocomplete_fields, custom widgets and validators
Formset support via inlines (StackedAdminActionInline, TabularAdminActionInline)
Easily testable with Django's built-in testing tools; compatible with django-no-queryset-admin-actions
pip install django-admin-action-forms
Add 'django_admin_action_forms' to INSTALLED_APPS.
References