Django CMS Admin Style
djangocms-admin-style provides a clean, modern, and user-friendly CSS styling layer for the Django admin interface, specifically tailored for django CMS projects. It aims to improve the visual consistency and user experience of the Django administration backend. The current version is 3.3.1, and it maintains a regular release cadence, often aligning with Django and django CMS major versions to ensure compatibility and address styling regressions.
Common errors
-
My Django admin interface looks plain, without the custom styles from django CMS, or the styles are inconsistent.
cause `djangocms_admin_style` is either missing from `INSTALLED_APPS` or is placed after `django.contrib.admin`.fixIn your `settings.py`, ensure `'djangocms_admin_style'` is included in `INSTALLED_APPS` and positioned *before* `'django.contrib.admin'`. -
Buttons or elements like the submit-row in the Django admin are misaligned or have incorrect spacing after upgrading Django to 4.2 or 5.0.
cause The installed version of `djangocms-admin-style` is not fully compatible with the CSS changes introduced in Django 4.2+ or 5.0, such as changes to flex display properties.fixUpgrade `djangocms-admin-style` to version 3.3.0 or newer: `pip install --upgrade djangocms-admin-style`. -
The picture upload widget in `djangocms-blog` is hidden or broken within the Django admin interface.
cause A specific CSS bug in `djangocms-admin-style` versions prior to 3.3.1 caused rendering issues for the picture upload widget in `djangocms-blog`.fixUpgrade `djangocms-admin-style` to version 3.3.1 or newer to fix the CSS rendering: `pip install --upgrade djangocms-admin-style`.
Warnings
- breaking Admin styling may break or render incorrectly with Django 4.2, Django 5.0, and newer versions due to upstream changes in Django's admin CSS (e.g., flex display for submit-row, dark mode features).
- gotcha Incorrect placement of `djangocms_admin_style` in `INSTALLED_APPS` will result in the default Django admin look without the custom styling being applied.
- gotcha Using `djangocms-admin-style` alongside other third-party Django admin themes (e.g., `grappelli`, `jazzmin`) can lead to CSS conflicts and unexpected rendering issues.
Install
-
pip install djangocms-admin-style
Imports
- 'djangocms_admin_style'
INSTALLED_APPS = [ 'djangocms_admin_style', 'django.contrib.admin', # ... other apps ]
Quickstart
# settings.py
INSTALLED_APPS = [
'djangocms_admin_style', # Must be 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
]
# No changes required in urls.py for basic styling.