unfold-admin
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDjango Unfold Admin
Django Unfold 管理后台
Modern Django admin theme with Tailwind CSS, HTMX, and Alpine.js. Replaces Django's default admin with a polished, feature-rich interface.
基于Tailwind CSS、HTMX和Alpine.js的现代化Django admin主题,以精致且功能丰富的界面替代Django默认的管理后台。
Quick Start
快速开始
Installation
安装
python
undefinedpython
undefinedsettings.py - unfold MUST be before django.contrib.admin
settings.py - unfold MUST be before django.contrib.admin
INSTALLED_APPS = [
"unfold",
"unfold.contrib.filters", # advanced filters
"unfold.contrib.forms", # array/wysiwyg widgets
"unfold.contrib.inlines", # nonrelated inlines
"unfold.contrib.import_export", # styled import/export
"unfold.contrib.guardian", # django-guardian integration
"unfold.contrib.simple_history", # django-simple-history integration
"unfold.contrib.constance", # django-constance integration
"unfold.contrib.location_field", # django-location-field integration
# ...
"django.contrib.admin",
]
undefinedINSTALLED_APPS = [
"unfold",
"unfold.contrib.filters", # advanced filters
"unfold.contrib.forms", # array/wysiwyg widgets
"unfold.contrib.inlines", # nonrelated inlines
"unfold.contrib.import_export", # styled import/export
"unfold.contrib.guardian", # django-guardian integration
"unfold.contrib.simple_history", # django-simple-history integration
"unfold.contrib.constance", # django-constance integration
"unfold.contrib.location_field", # django-location-field integration
# ...
"django.contrib.admin",
]
undefinedMinimal Admin
最简管理后台配置
python
from unfold.admin import ModelAdmin
@admin.register(MyModel)
class MyModelAdmin(ModelAdmin):
pass # inherits Unfold stylingpython
from unfold.admin import ModelAdmin
@admin.register(MyModel)
class MyModelAdmin(ModelAdmin):
pass # inherits Unfold stylingSite Configuration
站点配置
Replace the default or configure via dict in settings. See references/configuration.md for the complete settings reference.
AdminSiteUNFOLDpython
UNFOLD = {
"SITE_TITLE": "My Admin",
"SITE_HEADER": "My Admin",
"SITE_SYMBOL": "dashboard", # Material Symbols icon name
"SIDEBAR": {
"show_search": True,
"navigation": [
{
"title": _("Navigation"),
"items": [
{
"title": _("Dashboard"),
"icon": "dashboard",
"link": reverse_lazy("admin:index"),
},
],
},
],
},
}替换默认的或通过settings中的字典进行配置。完整设置参考请查看references/configuration.md。
AdminSiteUNFOLDpython
UNFOLD = {
"SITE_TITLE": "My Admin",
"SITE_HEADER": "My Admin",
"SITE_SYMBOL": "dashboard", # Material Symbols icon name
"SIDEBAR": {
"show_search": True,
"navigation": [
{
"title": _("Navigation"),
"items": [
{
"title": _("Dashboard"),
"icon": "dashboard",
"link": reverse_lazy("admin:index"),
},
],
},
],
},
}Core Workflow
核心工作流程
When building Unfold admin interfaces, follow this sequence:
- Configure site - UNFOLD settings dict (branding, sidebar, theme)
- Register models - Extend
unfold.admin.ModelAdmin - Enhance display - decorator for list columns
@display - Add actions - decorator for row/list/detail/submit actions
@action - Configure filters - Replace default filters with Unfold filter classes
- Override widgets - Apply Unfold widgets via
formfield_overrides - Set up inlines - Use Unfold's inline classes with tabs, pagination, sorting
- Build dashboard - +
@register_componentfor KPI cardsBaseComponent
构建Unfold管理界面时,请遵循以下步骤:
- 配置站点 - 使用UNFOLD设置字典(品牌、侧边栏、主题)
- 注册模型 - 继承
unfold.admin.ModelAdmin - 增强显示效果 - 使用装饰器优化列表列
@display - 添加操作 - 使用装饰器实现列表行/列表/详情/提交区域操作
@action - 配置过滤器 - 用Unfilter过滤器类替换默认过滤器
- 重写小部件 - 通过应用Unfold小部件
formfield_overrides - 设置内联组件 - 使用Unfold的内联类实现标签页、分页、排序功能
- 构建仪表盘 - 结合和
@register_component创建KPI卡片BaseComponent
ModelAdmin Attributes
ModelAdmin扩展属性
Unfold extends Django's with these additional attributes:
ModelAdmin| Attribute | Type | Purpose |
|---|---|---|
| bool | Full-width changelist (no sidebar) |
| bool | Add submit button to filters |
| bool | Filters in sliding sheet panel |
| bool | Compact field spacing in forms |
| bool | Warn before leaving unsaved form |
| str | Field name for drag-to-reorder |
| bool | Hide the ordering field column |
| bool | Scrollbar at top of list |
| bool | Disable "select all" checkbox |
| bool | Show cancel button on form |
| list | Global changelist actions |
| list | Per-row actions in changelist |
| list | Actions on change form |
| list | Actions in form submit area |
| bool | Hide default list actions |
| bool | Hide default detail actions |
| dict | JS expressions for field visibility |
| list | BaseDataset subclasses for change form |
| list | TableSection/TemplateSection for list |
| str | CSS grid classes for sections |
| dict | Transform readonly field content |
| list | Separate fieldsets for add form (like UserAdmin) |
Unfold为Django的扩展了以下额外属性:
ModelAdmin| 属性 | 类型 | 用途 |
|---|---|---|
| bool | 列表页全屏显示(无侧边栏) |
| bool | 为过滤器添加提交按钮 |
| bool | 在滑动面板中显示过滤器 |
| bool | 表单中字段间距紧凑显示 |
| bool | 未保存表单时离开页面发出警告 |
| str | 用于拖拽排序的字段名 |
| bool | 隐藏排序字段列 |
| bool | 列表顶部显示横向滚动条 |
| bool | 禁用"全选"复选框 |
| bool | 在表单中显示取消按钮 |
| list | 全局列表页操作 |
| list | 列表页每行操作 |
| list | 详情页操作 |
| list | 表单提交区域操作 |
| bool | 隐藏默认列表操作 |
| bool | 隐藏默认详情操作 |
| dict | 控制字段可见性的JS表达式 |
| list | 详情页使用的BaseDataset子类 |
| list | 列表页使用的TableSection/TemplateSection |
| str | 分区的CSS网格类 |
| dict | 转换只读字段内容 |
| list | 新增表单的独立字段集(类似UserAdmin) |
Template Injection Points
模板注入点
Insert custom HTML before/after changelist or change form:
python
class MyAdmin(ModelAdmin):
# Changelist
list_before_template = "myapp/list_before.html"
list_after_template = "myapp/list_after.html"
# Change form (inside <form> tag)
change_form_before_template = "myapp/form_before.html"
change_form_after_template = "myapp/form_after.html"
# Change form (outside <form> tag)
change_form_outer_before_template = "myapp/outer_before.html"
change_form_outer_after_template = "myapp/outer_after.html"在列表页或详情页前后插入自定义HTML:
python
class MyAdmin(ModelAdmin):
# 列表页
list_before_template = "myapp/list_before.html"
list_after_template = "myapp/list_after.html"
# 详情页(<form>标签内)
change_form_before_template = "myapp/form_before.html"
change_form_after_template = "myapp/form_after.html"
# 详情页(<form>标签外)
change_form_outer_before_template = "myapp/outer_before.html"
change_form_outer_after_template = "myapp/outer_after.html"Conditional Fields
条件字段
Show/hide fields based on other field values (Alpine.js expressions):
python
class MyAdmin(ModelAdmin):
conditional_fields = {
"premium_features": "plan == 'PRO'",
"discount_amount": "has_discount == true",
}基于其他字段值显示/隐藏字段(使用Alpine.js表达式):
python
class MyAdmin(ModelAdmin):
conditional_fields = {
"premium_features": "plan == 'PRO'",
"discount_amount": "has_discount == true",
}Actions System
操作系统
Four action types, each with different signatures. See references/actions-filters.md for complete reference.
python
from unfold.decorators import action
from unfold.enums import ActionVariant支持四种操作类型,每种类型有不同的签名。完整参考请查看references/actions-filters.md。
python
from unfold.decorators import action
from unfold.enums import ActionVariantList action (no object context)
列表操作(无对象上下文)
@action(description=_("Rebuild Index"), icon="sync", variant=ActionVariant.PRIMARY)
def rebuild_index(self, request):
# process...
return redirect(request.headers["referer"])
@action(description=_("Rebuild Index"), icon="sync", variant=ActionVariant.PRIMARY)
def rebuild_index(self, request):
# process...
return redirect(request.headers["referer"])
Row action (receives object_id)
行操作(接收object_id)
@action(description=_("Approve"), url_path="approve")
def approve_row(self, request, object_id):
obj = self.model.objects.get(pk=object_id)
return redirect(request.headers["referer"])
@action(description=_("Approve"), url_path="approve")
def approve_row(self, request, object_id):
obj = self.model.objects.get(pk=object_id)
return redirect(request.headers["referer"])
Detail action (receives object_id, shown on change form)
详情操作(接收object_id,显示在详情页)
@action(description=_("Send Email"), permissions=["send_email"])
def send_email(self, request, object_id):
return redirect(reverse_lazy("admin:myapp_mymodel_change", args=[object_id]))
@action(description=_("Send Email"), permissions=["send_email"])
def send_email(self, request, object_id):
return redirect(reverse_lazy("admin:myapp_mymodel_change", args=[object_id]))
Submit line action (receives obj instance, runs on save)
提交区域操作(接收obj实例,保存时执行)
@action(description=_("Save & Publish"))
def save_and_publish(self, request, obj):
obj.published = True
undefined@action(description=_("Save & Publish"))
def save_and_publish(self, request, obj):
obj.published = True
undefinedAction Groups (Dropdown Menus)
操作组(下拉菜单)
python
actions_list = [
"primary_action",
{
"title": _("More"),
"variant": ActionVariant.PRIMARY,
"items": ["secondary_action", "tertiary_action"],
},
]python
actions_list = [
"primary_action",
{
"title": _("More"),
"variant": ActionVariant.PRIMARY,
"items": ["secondary_action", "tertiary_action"],
},
]Permissions
权限控制
python
@action(permissions=["can_export", "auth.view_user"])
def export_data(self, request):
pass
def has_can_export_permission(self, request):
return request.user.is_superuserpython
@action(permissions=["can_export", "auth.view_user"])
def export_data(self, request):
pass
def has_can_export_permission(self, request):
return request.user.is_superuserDisplay Decorator
显示装饰器
Enhance list_display columns. See references/actions-filters.md.
python
from unfold.decorators import display增强list_display列的显示效果。参考references/actions-filters.md。
python
from unfold.decorators import displayColored status labels
带颜色的状态标签
@display(description=_("Status"), ordering="status", label={
"active": "success", # green
"pending": "info", # blue
"warning": "warning", # orange
"inactive": "danger", # red
})
def show_status(self, obj):
return obj.status
@display(description=_("Status"), ordering="status", label={
"active": "success", # green
"pending": "info", # blue
"warning": "warning", # orange
"inactive": "danger", # red
})
def show_status(self, obj):
return obj.status
Rich header with avatar
带头像的富文本头部
@display(description=_("User"), header=True)
def show_header(self, obj):
return [
obj.full_name, # primary text
obj.email, # secondary text
obj.initials, # badge text
{"path": obj.avatar.url, "width": 24, "height": 24, "borderless": True},
]
@display(description=_("User"), header=True)
def show_header(self, obj):
return [
obj.full_name, # primary text
obj.email, # secondary text
obj.initials, # badge text
{"path": obj.avatar.url, "width": 24, "height": 24, "borderless": True},
]
Interactive dropdown
交互式下拉菜单
@display(description=_("Teams"), dropdown=True)
def show_teams(self, obj):
return {
"title": f"{obj.teams.count()} teams",
"items": [{"title": t.name, "link": t.get_admin_url()} for t in obj.teams.all()],
"striped": True,
"max_height": 200,
}
@display(description=_("Teams"), dropdown=True)
def show_teams(self, obj):
return {
"title": f"{obj.teams.count()} teams",
"items": [{"title": t.name, "link": t.get_admin_url()} for t in obj.teams.all()],
"striped": True,
"max_height": 200,
}
Boolean checkmark
布尔值勾选框
@display(description=_("Active"), boolean=True)
def is_active(self, obj):
return obj.is_active
undefined@display(description=_("Active"), boolean=True)
def is_active(self, obj):
return obj.is_active
undefinedFilters
过滤器
Unfold provides advanced filter classes. See references/actions-filters.md.
python
from unfold.contrib.filters.admin import (
TextFilter, RangeNumericFilter, RangeDateFilter, RangeDateTimeFilter,
SingleNumericFilter, SliderNumericFilter, RelatedDropdownFilter,
RelatedCheckboxFilter, ChoicesCheckboxFilter, AllValuesCheckboxFilter,
BooleanRadioFilter, CheckboxFilter, AutocompleteSelectMultipleFilter,
)
class MyAdmin(ModelAdmin):
list_filter_submit = True # required for input-based filters
list_filter = [
("salary", RangeNumericFilter),
("status", ChoicesCheckboxFilter),
("created_at", RangeDateFilter),
("category", RelatedDropdownFilter),
("is_active", BooleanRadioFilter),
]Unfold提供高级过滤器类。参考references/actions-filters.md。
python
from unfold.contrib.filters.admin import (
TextFilter, RangeNumericFilter, RangeDateFilter, RangeDateTimeFilter,
SingleNumericFilter, SliderNumericFilter, RelatedDropdownFilter,
RelatedCheckboxFilter, ChoicesCheckboxFilter, AllValuesCheckboxFilter,
BooleanRadioFilter, CheckboxFilter, AutocompleteSelectMultipleFilter,
)
class MyAdmin(ModelAdmin):
list_filter_submit = True # required for input-based filters
list_filter = [
("salary", RangeNumericFilter),
("status", ChoicesCheckboxFilter),
("created_at", RangeDateFilter),
("category", RelatedDropdownFilter),
("is_active", BooleanRadioFilter),
]Custom Text Filter
自定义文本过滤器
python
class NameFilter(TextFilter):
title = _("Name")
parameter_name = "name"
def queryset(self, request, queryset):
if self.value() in EMPTY_VALUES:
return queryset
return queryset.filter(name__icontains=self.value())python
class NameFilter(TextFilter):
title = _("Name")
parameter_name = "name"
def queryset(self, request, queryset):
if self.value() in EMPTY_VALUES:
return queryset
return queryset.filter(name__icontains=self.value())Widgets
小部件
Override form widgets for Unfold styling. See references/widgets-inlines.md.
python
from unfold.widgets import (
UnfoldAdminTextInputWidget, UnfoldAdminSelectWidget, UnfoldAdminSelect2Widget,
UnfoldBooleanSwitchWidget, UnfoldAdminColorInputWidget,
UnfoldAdminSplitDateTimeWidget, UnfoldAdminImageFieldWidget,
)
from unfold.contrib.forms.widgets import WysiwygWidget, ArrayWidget
class MyAdmin(ModelAdmin):
formfield_overrides = {
models.TextField: {"widget": WysiwygWidget},
models.ImageField: {"widget": UnfoldAdminImageFieldWidget},
}重写表单小部件以应用Unfold样式。参考references/widgets-inlines.md。
python
from unfold.widgets import (
UnfoldAdminTextInputWidget, UnfoldAdminSelectWidget, UnfoldAdminSelect2Widget,
UnfoldBooleanSwitchWidget, UnfoldAdminColorInputWidget,
UnfoldAdminSplitDateTimeWidget, UnfoldAdminImageFieldWidget,
)
from unfold.contrib.forms.widgets import WysiwygWidget, ArrayWidget
class MyAdmin(ModelAdmin):
formfield_overrides = {
models.TextField: {"widget": WysiwygWidget},
models.ImageField: {"widget": UnfoldAdminImageFieldWidget},
}Text Input with Icons
带图标的文本输入框
python
widget = UnfoldAdminTextInputWidget(attrs={
"prefix_icon": "search",
"suffix_icon": "euro",
})python
widget = UnfoldAdminTextInputWidget(attrs={
"prefix_icon": "search",
"suffix_icon": "euro",
})Inlines
内联组件
Unfold inlines support tabs, pagination, sorting, and nonrelated models. See references/widgets-inlines.md.
python
from unfold.admin import TabularInline, StackedInline
from unfold.contrib.inlines.admin import NonrelatedStackedInline
class OrderItemInline(TabularInline):
model = OrderItem
tab = True # show as tab
per_page = 10 # paginated
ordering_field = "weight" # drag-to-reorder
hide_title = True
collapsible = TrueUnfold内联组件支持标签页、分页、排序和非关联模型。参考references/widgets-inlines.md。
python
from unfold.admin import TabularInline, StackedInline
from unfold.contrib.inlines.admin import NonrelatedStackedInline
class OrderItemInline(TabularInline):
model = OrderItem
tab = True # show as tab
per_page = 10 # paginated
ordering_field = "weight" # drag-to-reorder
hide_title = True
collapsible = TrueFieldset Tabs
字段集标签页
Group fieldsets into tabs using :
"classes": ["tab"]python
fieldsets = [
(None, {"fields": ["name", "email"]}), # always visible
(_("Profile"), {"classes": ["tab"], "fields": ["bio", "avatar"]}),
(_("Settings"), {"classes": ["tab"], "fields": ["theme", "notifications"]}),
]使用将字段组分组成标签页:
"classes": ["tab"]python
fieldsets = [
(None, {"fields": ["name", "email"]}), # always visible
(_("Profile"), {"classes": ["tab"], "fields": ["bio", "avatar"]}),
(_("Settings"), {"classes": ["tab"], "fields": ["theme", "notifications"]}),
]Dashboard Components
仪表盘组件
Build KPI cards and custom dashboard widgets. See references/dashboard.md.
python
from unfold.components import BaseComponent, register_component
from django.template.loader import render_to_string
@register_component
class ActiveUsersComponent(BaseComponent):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["children"] = render_to_string("myapp/kpi_card.html", {
"total": User.objects.filter(is_active=True).count(),
"label": "Active Users",
})
return contextConfigure in settings:
python
UNFOLD = {
"DASHBOARD_CALLBACK": "myapp.views.dashboard_callback",
}构建KPI卡片和自定义仪表盘小部件。参考references/dashboard.md。
python
from unfold.components import BaseComponent, register_component
from django.template.loader import render_to_string
@register_component
class ActiveUsersComponent(BaseComponent):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["children"] = render_to_string("myapp/kpi_card.html", {
"total": User.objects.filter(is_active=True).count(),
"label": "Active Users",
})
return context在settings中配置:
python
UNFOLD = {
"DASHBOARD_CALLBACK": "myapp.views.dashboard_callback",
}Sections (Changelist Panels)
分区(列表页面板)
Embed related data panels in changelist views:
python
from unfold.sections import TableSection, TemplateSection
class RecentOrdersSection(TableSection):
related_name = "order_set"
fields = ["id", "total", "status"]
height = 380
class ChartSection(TemplateSection):
template_name = "myapp/chart.html"
class MyAdmin(ModelAdmin):
list_sections = [RecentOrdersSection, ChartSection]
list_sections_classes = "lg:grid-cols-2"在列表页中嵌入关联数据面板:
python
from unfold.sections import TableSection, TemplateSection
class RecentOrdersSection(TableSection):
related_name = "order_set"
fields = ["id", "total", "status"]
height = 380
class ChartSection(TemplateSection):
template_name = "myapp/chart.html"
class MyAdmin(ModelAdmin):
list_sections = [RecentOrdersSection, ChartSection]
list_sections_classes = "lg:grid-cols-2"Datasets (Change Form Panels)
数据集(详情页面板)
Embed model listings within change forms:
python
from unfold.datasets import BaseDataset
class RelatedItemsDatasetAdmin(ModelAdmin):
list_display = ["name", "status"]
search_fields = ["name"]
class RelatedItemsDataset(BaseDataset):
model = RelatedItem
model_admin = RelatedItemsDatasetAdmin
tab = True # show as tab
class MyAdmin(ModelAdmin):
change_form_datasets = [RelatedItemsDataset]在详情页中嵌入模型列表:
python
from unfold.datasets import BaseDataset
class RelatedItemsDatasetAdmin(ModelAdmin):
list_display = ["name", "status"]
search_fields = ["name"]
class RelatedItemsDataset(BaseDataset):
model = RelatedItem
model_admin = RelatedItemsDatasetAdmin
tab = True # show as tab
class MyAdmin(ModelAdmin):
change_form_datasets = [RelatedItemsDataset]Paginator
分页器
Use infinite scroll pagination:
python
from unfold.paginator import InfinitePaginator
class MyAdmin(ModelAdmin):
paginator = InfinitePaginator
show_full_result_count = False
list_per_page = 20使用无限滚动分页:
python
from unfold.paginator import InfinitePaginator
class MyAdmin(ModelAdmin):
paginator = InfinitePaginator
show_full_result_count = False
list_per_page = 20Third-Party Integrations
第三方集成
Unfold provides styled wrappers for common Django packages. See references/resources.md for complete setup guides.
| Package | Unfold Module | Setup |
|---|---|---|
| django-import-export | | Use |
| django-guardian | | Styled guardian integration |
| django-simple-history | | Styled history integration |
| django-constance | | Styled constance config |
| django-location-field | | Location widget |
| django-modeltranslation | Compatible | Mix |
| django-celery-beat | Compatible (rewire) | Unregister 5 models, re-register with Unfold |
| django-money | | |
| djangoql | Compatible | Mix |
| django-crispy-forms | Compatible | Unfold template pack available |
python
undefinedUnfold为常见Django包提供样式化封装。完整设置指南请参考references/resources.md。
| 包 | Unfold模块 | 设置方式 |
|---|---|---|
| django-import-export | | 使用 |
| django-guardian | | 样式化的guardian集成 |
| django-simple-history | | 样式化的历史记录集成 |
| django-constance | | 样式化的constance配置 |
| django-location-field | | 位置选择小部件 |
| django-modeltranslation | 兼容 | 将 |
| django-celery-beat | 兼容(需重新注册) | 注销5个模型,使用Unfold重新注册 |
| django-money | | |
| djangoql | 兼容 | 将 |
| django-crispy-forms | 兼容 | 提供Unfold模板包 |
python
undefinedMultiple inheritance - Unfold ModelAdmin always last
多重继承 - Unfold ModelAdmin必须放在最后
@admin.register(MyModel)
class MyAdmin(DjangoQLSearchMixin, SimpleHistoryAdmin, GuardedModelAdmin, ModelAdmin):
pass
undefined@admin.register(MyModel)
class MyAdmin(DjangoQLSearchMixin, SimpleHistoryAdmin, GuardedModelAdmin, ModelAdmin):
pass
undefinedBuilt-In Template Components
内置模板组件
Unfold ships reusable template components for dashboards and custom pages:
| Component | Path | Key Variables |
|---|---|---|
| Card | | |
| Bar Chart | | |
| Line Chart | | |
| Progress | | |
| Table | | |
| Button | | |
| Tracker | | |
| Cohort | | |
html
{% load unfold %}
{% component "MyKPIComponent" %}{% endcomponent %}Unfold提供可复用的模板组件,用于仪表盘和自定义页面:
| 组件 | 路径 | 关键变量 |
|---|---|---|
| 卡片 | | |
| 柱状图 | | |
| 折线图 | | |
| 进度条 | | |
| 表格 | | |
| 按钮 | | |
| 追踪器 | | |
| 同期群分析 | | |
html
{% load unfold %}
{% component "MyKPIComponent" %}{% endcomponent %}User Admin Forms
用户管理后台表单
Unfold provides styled versions of Django's auth admin forms:
python
from unfold.forms import AdminPasswordChangeForm, UserChangeForm, UserCreationForm
@admin.register(User)
class UserAdmin(BaseUserAdmin, ModelAdmin):
form = UserChangeForm
add_form = UserCreationForm
change_password_form = AdminPasswordChangeFormUnfold提供Django auth管理表单的样式化版本:
python
from unfold.forms import AdminPasswordChangeForm, UserChangeForm, UserCreationForm
@admin.register(User)
class UserAdmin(BaseUserAdmin, ModelAdmin):
form = UserChangeForm
add_form = UserCreationForm
change_password_form = AdminPasswordChangeFormReference Files
参考文档
Detailed documentation split by topic:
- references/configuration.md - Complete UNFOLD settings dict, sidebar, tabs, theming, environment, login
- references/actions-filters.md - Action types and signatures, display decorator, all filter classes
- references/widgets-inlines.md - Complete widget class list (35+), inline variants, nonrelated inlines, forms
- references/dashboard.md - Dashboard components, sections, datasets, custom templates, Tailwind patterns
- references/resources.md - Official links, all third-party integrations, common patterns, version compatibility, Unfold Studio
Read the relevant reference file when you need detailed configuration options, the full list of available classes, complete code examples, or integration setup guides for a specific feature area.
按主题拆分的详细文档:
- references/configuration.md - 完整的UNFOLD设置字典、侧边栏、标签页、主题、环境、登录配置
- references/actions-filters.md - 操作类型和签名、显示装饰器、所有过滤器类
- references/widgets-inlines.md - 完整的小部件类列表(30+)、内联变体、非关联内联、表单
- references/dashboard.md - 仪表盘组件、分区、数据集、自定义模板、Tailwind模式
- references/resources.md - 官方链接、所有第三方集成、常见模式、版本兼容性、Unfold Studio
当需要详细配置选项、完整的可用类列表、完整代码示例或特定功能区域的集成设置指南时,请阅读对应的参考文档。
Key External References
关键外部参考
| Resource | URL |
|---|---|
| Docs | https://unfoldadmin.com/docs/ |
| GitHub | https://github.com/unfoldadmin/django-unfold |
| Demo App (Formula) | https://github.com/unfoldadmin/formula |
| Live Demo | https://demo.unfoldadmin.com |
| Material Symbols (Icons) | https://fonts.google.com/icons |
When uncertain about an implementation pattern, consult and in the Formula demo repo - it covers virtually every Unfold feature.
formula/admin.pyformula/settings.py| 资源 | 链接 |
|---|---|
| 官方文档 | https://unfoldadmin.com/docs/ |
| GitHub仓库 | https://github.com/unfoldadmin/django-unfold |
| 示例应用(Formula) | https://github.com/unfoldadmin/formula |
| 在线演示 | https://demo.unfoldadmin.com |
| Material Symbols(图标) | https://fonts.google.com/icons |
当不确定实现方式时,请参考Formula演示仓库中的和——它几乎覆盖了Unfold的所有功能。
formula/admin.pyformula/settings.py