from django.core.management import call_command from django.db import migrations def load_admin_theme(apps, schema_editor): # Seeds the default django-admin-interface theme (see # accounts/fixtures/admin_interface_theme.json). Runs once, the first # time this migration is applied, so it won't clobber a theme later # edited by hand through the admin. call_command("loaddata", "admin_interface_theme.json") class Migration(migrations.Migration): dependencies = [ ("accounts", "0002_customuser_points"), ("admin_interface", "0032_alter_theme_defaults"), ] operations = [ migrations.RunPython(load_admin_theme, migrations.RunPython.noop), ]