Django Jazzmin
Django Jazzmin is a drop-in theme for the Django admin interface, leveraging AdminLTE 3.2 and Bootstrap 5 to provide a modern and highly customizable user experience. It offers numerous features including customisable menus, various change form templates, Bootstrap 5 modals, and a built-in UI customizer. The project is actively maintained, with frequent releases addressing bug fixes and introducing new features, currently at version 3.0.4.
Warnings
- breaking Version 3.0.0 dropped official support for Python versions 3.6 & 3.7 and Django versions 2.2, 3.0 & 3.1. Ensure your project meets the new minimum requirements (Python >=3.10, Django >=4.0).
- breaking Version 3.0.3 migrated all templates, CSS, and JS from Bootstrap 4 to Bootstrap 5. If you have custom templates or extensive UI tweaks, these may require updates (e.g., `data-toggle` to `data-bs-toggle`, `data-dismiss` to `data-bs-dismiss`).
- deprecated The `dark_mode_theme` setting was replaced by `default_theme_mode` in v3.0.3. While it might still be treated as `default_theme_mode: 'auto'` with a deprecation warning, it's best to update your configuration.
- gotcha Logout functionality in Django Admin (especially with Django 5.0+) can sometimes fail with a 405 'Method Not Allowed' error when using Jazzmin. This is often due to the logout link being a GET request instead of a POST.
- gotcha The 'Related Modal' feature for linked objects might be blocked by Django's Clickjacking Protection (`X_FRAME_OPTIONS`).
- gotcha Users have reported `collectstatic` failures and missing static files (e.g., `bootstrap.bundle.min.js.map`) after upgrading to 3.0.4, indicating potential issues with static file management.
Install
-
pip install django-jazzmin
Imports
- jazzmin
INSTALLED_APPS = [ 'jazzmin', 'django.contrib.admin', # ... other apps ]
Quickstart
# settings.py
INSTALLED_APPS = [
'jazzmin', # Add Jazzmin here, BEFORE django.contrib.admin
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# Your other apps
]
# Optional: Customize Jazzmin settings
JAZZMIN_SETTINGS = {
"site_title": "My Custom Admin",
"site_header": "My Admin Dashboard",
"welcome_sign": "Welcome to the admin area",
"copyright": "My Company Ltd",
"topmenu_links": [
{"name": "Home", "url": "admin:index", "permissions": ["auth.view_user"]},
{"name": "Support", "url": "https://github.com/farridav/django-jazzmin/issues", "new_window": True},
{"model": "auth.User"},
]
}
# Terminal
# Run migrations and start the server
# python manage.py migrate
# python manage.py createsuperuser # If you don't have one
# python manage.py runserver