Prerequisites
Before installing Django Unfold, ensure your project meets these requirements:Python Version
Python 3.11 or higher
Django Version
Django 4.2, 5.0, 5.1, 5.2, or 6.0
Installation Steps
Install the Package
Install Django Unfold using pip:This will install the latest stable version from PyPI.
Update INSTALLED_APPS
Add
unfold to your INSTALLED_APPS in settings.py. Important: Place it before django.contrib.admin:settings.py
The order is critical! Unfold must be listed before
django.contrib.admin to properly override the default admin templates.Collect Static Files
Run Django’s This copies all CSS, JavaScript, and other static files to your
collectstatic command to gather Unfold’s static assets:STATIC_ROOT directory.Optional Dependencies
Django Unfold includes optional integrations for popular Django packages. Install these if you need their functionality:Advanced Filters
Advanced Filters
For enhanced filtering capabilities:
settings.py
Form Enhancements
Form Enhancements
For improved form widgets and styling:
settings.py
Inline Enhancements
Inline Enhancements
For advanced inline features:
settings.py
Import/Export Integration
Import/Export Integration
For django-import-export support:
settings.py
Simple History Integration
Simple History Integration
For django-simple-history support:
settings.py
Guardian Integration
Guardian Integration
For django-guardian permission support:
settings.py
Constance Integration
Constance Integration
For django-constance dynamic settings:
settings.py
Configuration
Basic Configuration
Django Unfold works out of the box with sensible defaults. However, you can customize various aspects through yoursettings.py:
settings.py
Static Files Configuration
Ensure your static files are properly configured:settings.py
Media Files Configuration
If you’re using file uploads in your admin:settings.py
Running Alongside Default Admin
Django Unfold supports running alongside the default Django admin. This is useful for gradual migration or testing:When running both admin interfaces, you can access the default admin at
/admin/ and the Unfold admin at /unfold-admin/.Troubleshooting
Admin interface looks the same as before
Admin interface looks the same as before
Solution: Make sure
unfold is listed before django.contrib.admin in INSTALLED_APPS and that you’ve run collectstatic.Static files not loading
Static files not loading
Solution: Run
python manage.py collectstatic and verify your STATIC_URL and STATIC_ROOT settings are correct.Import errors when using Unfold components
Import errors when using Unfold components
Solution: Ensure you’re importing from the correct modules:
Templates not found
Templates not found
Solution: Check that
APP_DIRS is set to True in your TEMPLATES setting:Next Steps
Now that Django Unfold is installed, you’re ready to start building your admin interface:Quick Start Guide
Learn how to create your first Unfold admin interface
Full Documentation
Explore all features and configuration options
Installation complete! Continue to the Quick Start guide to build your first admin interface.