Django Unfold logo

Django Unfold

Organization
CodeAtCode
django-unfold

Use when theming the Django admin with django-unfold - settings and sidebar configuration, custom admin site, components and @display decorator, filters, actions, tabs, dark mode and styling, or Django 6.x compatibility

Overview

PublisherCodeAtCode
Repositoryoss-ai-skills
Skill namedjango-unfold
Stars
30
Forks
3
Bundled files
3
LicenseGPL-3.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by CodeAtCode on GitHub. Read the source before you install it.

Installation

Install the Django Unfold AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/CodeAtCode/oss-ai-skills/tree/master/frameworks/django-unfold
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/CodeAtCode/oss-ai-skills.git /tmp/oss-ai-skills
mkdir -p .claude/skills
cp -r /tmp/oss-ai-skills/frameworks/django-unfold .claude/skills/django-unfold
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Django Unfold in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Django Unfold on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Django Unfold is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Django Unfold

Objective: Use this skill to reduce admin-broken-layout incidents, @display-misuse bugs, filter-registration failures, and dark-mode regressions by enforcing settings-discipline, decorator-contract rules, and component-registration patterns below.

Modern Django admin theme with Tailwind-based design.


Core Rules (do X because Y)

  1. Put unfold before django.contrib.admin in INSTALLED_APPS because the template engine loads the first admin app it finds and later apps are ignored.

  2. Extend unfold/base.html not admin/base.html because extending the stock Django base bypasses Unfold's CSS, sidebar, and dark-mode blocks.

  3. Use UPPER_CASE keys in UNFOLD dict because lowercase keys are silently ignored at runtime.

  4. Define UNFOLD in settings.py not admin.py because the theme reads settings at import time; putting it in admin.py causes partial initialization.

  5. Register @display methods before list_display references them because late decorators don't bind to the admin metaclass and the column renders empty.

  6. Use UNFOLD's COLORS palette not raw CSS overrides because !important rules fight the Tailwind cascade and break on Unfold updates.

  7. Test dark mode with system preference toggled because DARK_MODE_COLORS that mirror light mode create invisible text and broken contrast.


Installation

bash
pip install django-unfold
python
# settings.py
INSTALLED_APPS = [
    'unfold',  # Must come BEFORE django.contrib.admin
    'django.contrib.admin',
    'django.contrib.auth',
    # ...
]

UNFOLD = {
    'SITE_HEADER': 'My Admin',
}

Custom Admin Site

Do this because: Default admin site class doesn't expose custom context or override authentication flow.

python
# admin.py
from unfold.admin import UnfoldAdminSite

class CustomAdminSite(UnfoldAdminSite):
    site_header = 'Custom Portal'
    
    def each_context(self, request):
        context = super().each_context(request)
        context['custom_branding'] = get_branding()
        return context

admin_site = CustomAdminSite(name='custom')
python
# settings.py
UNFOLD_ADMIN_SITE_CLASS = 'myapp.admin.CustomAdminSite'

See references/settings-customization.md for full settings reference, sidebar config, and dark mode controls.


@display Decorator (Django 6.0+)

Do this because: Without proper decorator usage, list_display columns render empty or unsortable.

python
from unfold.decorators import display

class UserAdmin(ModelAdmin):
    @display(description="Active", boolean=True)
    def is_active(self, obj):
        return obj.is_active
    
    @display(description="Full Name", order="username")
    def full_name(self, obj):
        return f"{obj.first_name} {obj.last_name}"
    
    list_display = ['username', 'is_active', 'full_name']

Failure mode: Column shows blank because @display must be applied before the method is referenced in list_display.

See references/components-actions.md for @display parameters and field/widget patterns.


Filters

Do this because: Default admin filters don't integrate with Unfold's dropdown styling and can break on large FK fields.

python
import unfold.filters as filters

class ArticleAdmin(ModelAdmin):
    list_filter = [
        ('status', filters.DropdownFilter),  # Better than SelectFilter for long lists
        ('author', filters.AutocompleteFilter),  # Required for >100 authors
        ('created_at', filters.DateRangeFilter),
    ]

Failure mode: Filter dropdown renders as stock Django select because you used list_filter = ['field'] without Unfold's filter class.

See references/components-actions.md for complete filter type listings.


Actions

Do this because: Stock admin actions lack Unfold's button styling and confirmation UI.

python
from unfold.decorators import action

class ArticleAdmin(ModelAdmin):
    @action(description='Publish selected articles')
    def publish_selected(self, request, queryset):
        queryset.update(status='published')
    
    actions = ['publish_selected']

Failure mode: Action runs but shows no success message because message_level wasn't set or the method wasn't registered in actions.

See references/components-actions.md for row actions and CSV export patterns.


Common Pitfalls

INSTALLED_APPS Ordering

Failure: Unfold silently ignored, admin renders with default Django theme.

python
# WRONG
INSTALLED_APPS = [
    'django.contrib.admin',  # ❌ Already loaded templates
    'unfold',
]

# CORRECT
INSTALLED_APPS = [
    'unfold',  # ✅ Template override works
    'django.contrib.admin',
]

Template Extension Mistake

Failure: Custom template loses Unfold styling.

python
# WRONG
{% extends "admin/base.html" %}  # ❌ No Unfold blocks

# CORRECT
{% extends "unfold/base.html" %}  # ✅ Gets CSS, layout, sidebar

Styling Without Theme Pipeline

Failure: Custom CSS conflicts with Unfold's Tailwind classes.

python
# WRONG
UNFOLD = {
    'STYLES': ['css/custom.css'],
}
/* custom.css */
.sidebar { background: blue !important; }  # ❌ Brittle

Correct:

python
UNFOLD = {
    'COLORS': {
        'primary': {
            '500': '59 130 246',
        },
    },
}

Integrations

django-guardian

Do this because: You need per-object permissions beyond Django's model-level permissions.

python
INSTALLED_APPS = ['guardian', 'unfold', 'django.contrib.admin']

from unfold.contrib.guardian.admin import GuardedModelAdmin

class ArticleAdmin(GuardedModelAdmin):
    pass

URL: https://github.com/django-guardian/django-guardian

django-import-export

Do this because: Non-technical users need bulk import/export via admin.

python
from import_export import resources
from unfold.admin import ImportExportMixin

class ArticleResource(resources.ModelResource):
    class Meta:
        model = Article
        fields = ('id', 'title', 'status')

class ArticleAdmin(ImportExportMixin, ModelAdmin):
    resource_classes = [ArticleResource]

URL: https://github.com/django-import-export/django-import-export

django-celery-beat

Do this because: You need cron-like scheduling with admin UI.

python
# Automatic integration - no config needed
pip install django-celery-beat

URL: https://github.com/celery/django-celery-beat

django-constance

Do this because: You need runtime site-wide settings without redeploy.

python
INSTALLED_APPS = ['constance', 'unfold']
# Automatic integration

URL: https://github.com/jazzband/django-constance

See references/ecosystem-compat.md for django-unfold-modal, django-unfold-markdown, and Django 6.x compatibility patches.


When Not to Use Unfold

Stock Django admin is sufficient when:

  • Small internal projects — Admin used by <5 power users, no branding requirements
  • Heavy customization needed — Unfold's template override layer becomes maintenance cost when rewriting 50% of templates
  • No Tailwind expertise — Adding Tailwind build pipeline just for admin theming is overkill

Check before adopting:

  1. Does your team have Tailwind CSS experience?
  2. Will admin branding be reviewed by stakeholders?
  3. Is the admin used frequently enough to justify the UX investment?

Deep Dives

For detailed reference, load these on-demand:

  • Settings & Customization — references/settings-customization.md - Full settings reference, custom admin site, dark mode, sidebar config
  • Components & Actions — references/components-actions.md - @display decorator, filters, actions, tabs, fields/widgets
  • Ecosystem & Compatibility — references/ecosystem-compat.md - django-unfold-modal, django-unfold-markdown, Django 6.x patches

References

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Django Unfold AI skill do?

Use when theming the Django admin with django-unfold - settings and sidebar configuration, custom admin site, components and @display decorator, filters, actions, tabs, dark mode and styling, or Django 6.x compatibility

Why use Django Unfold on TypingMind?

Because you install it once and use it with any model. Django Unfold is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Django Unfold in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/CodeAtCode/oss-ai-skills/tree/master/frameworks/django-unfold. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Django Unfold?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Django Unfold?

As many as you like. As long as a model supports skills, you can use Django Unfold with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Django Unfold AI skill free?

Yes. It is published on GitHub by CodeAtCode under the GPL-3.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇