Installation
Installing django-palette is straightforward. Follow the steps below to get it working in your Django project.
Prerequisites
Python 3.7 or higher
Django 2.2 or higher
pip
Step 1: Install the Package
Install django-palette using pip:
pip install dj-palette
Step 2: Add to INSTALLED_APPS
In your Django project’s settings.py, add dj_palette and dj_palette.palette_admin to the INSTALLED_APPS list:
INSTALLED_APPS = [
'dj_palette', # Add this
'dj_palette.palette_admin', # Add this
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# ... your other apps
]
The order matters - dj_palette should come before django.contrib.admin, only if you want to use the Django Palette Admin UI.
Note
Also set X_FRAME_OPTIONS = 'SAMEORIGIN' when using dj_palette.palette_admin. This is necessary because Django Palette Admin uses modal instead of the normal popup windows when adding related fields.
Step 3: Configure URLs (Optional)
By default, django-palette works with the standard Django admin. If you want to use a custom admin site, you can configure it:
# urls.py
from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
# ... other patterns
]
Step 4: Run Migrations
If you’re using dj_palette.palette_admin, run migrations to set up the necessary tables:
python manage.py migrate
Step 5: Collect Static Files
Collect static files so Bootstrap, icons, and other assets are available:
python manage.py collectstatic
This will copy all CSS, JS, and font files to your static files directory.
Step 6: Create a Superuser (if needed)
If you haven’t already, create a superuser account:
python manage.py createsuperuser
Step 7: Test the Installation
Start your development server:
python manage.py runserver
Visit http://localhost:8000/admin/ and log in with your superuser credentials. You should see the beautiful django-palette admin interface!
Troubleshooting
Static Files Not Loading
If CSS and JS aren’t loading:
Make sure
django.contrib.staticfilesis inINSTALLED_APPSRun
python manage.py collectstaticagainCheck that
STATIC_URLis set in settings.py (default is/static/)
Import Errors
If you get import errors:
Make sure
dj_paletteis inINSTALLED_APPSVerify the package was installed:
pip show dj-paletteCheck that there are no circular imports in your settings
Templates Not Found
If admin templates aren’t showing:
Ensure
APP_DIRSis True in the TEMPLATES configuration (default is True)Make sure
dj_palettecomes beforedjango.contrib.admininINSTALLED_APPS
Upgrade from Previous Version
To upgrade to the latest version:
pip install --upgrade dj-palette
Then run migrations:
python manage.py migrate
Next Steps
Great! Now that django-palette is installed, check out:
Quick Start - Get it working in 5 minutes
Features - Explore all features
Template Tags - Learn the template tags
Examples - See code examples
Need Help?
Read the full documentation at https://django-palette.readthedocs.io
Check the GitHub README
Open an issue on GitHub