Skip to main content

Disable dark mode in Django admin user interface in Django 3.2.x.

Project description

Disable or enable dark mode user interface in Django admin panel (Django==3.2).


For install this app run in terminal:

pip install django-non-dark-admin

Configuration for all users

Add ‘’django_non_dark_admin’’ to your INSTALLED_APPS settings. This is must be added BEFORE ‘’django.contrib.admin’’.

Set ‘’DISABLE_DARK_MODE = True’’ in your settings module to disable dark mode in admin panel user interface to all users.

Configuration per user

To have the theme configured as a user preference you will need to have a custom user model (model configured in settings.AUTH_USER_MODEL) as described in Django documentation:

Add a boolean field disable_dark_mode to your custom user model:

disable_dark_mode = models.BooleanField(
    verbose_name="Django Admin Theme",
    default=False choices=((False, "Dark"),
    (True, "Light")),

After adding the field, run:

python makemigrations

It should generate a migration like this:

# Generated by Django 3.2.9 on 2021-12-27 19:17

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ("app_for_the_auth_custom_model", "0XXX_previous_migration"),

    operations = [
            model_name="<Your Custom Auth User model>",
                choices=[(False, "Dark"), (True, "Light")],

Run the migration:

python migrate

And the field will be added to your AUTH_USER_MODEL.

Go to the Django admin for your custom user model and add the field to be editable.


Licensed under BSD license. See license link in documentation.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-non-dark-admin-2.0.2.tar.gz (5.2 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page