Management Commands
clean_migrations
Squashes all migrations for a set of apps that share a common name prefix. Performs the following steps interactively (with confirmation prompts at each stage):
Deletes all
django_migrationsrows for the matched apps except0001_initial.Deletes all migration
.pyfiles from each app’smigrations/folder.Runs
makemigrationsfor each app to generate a single fresh0001_initialmigration.
python manage.py clean_migrations --app_prefix myproject
The --app_prefix argument filters INSTALLED_APPS — only apps whose
name starts with the given prefix are processed.
Warning
This command is destructive. Run it only when all existing migrations are already applied to the target database, and ensure the database schema matches what Django would generate from scratch.
Requires icecream (pip install icecream) for debug output.
rqscheduler
Starts an RQ Scheduler worker. This is a thin wrapper around
django-rq’s scheduler command, available through the pragmatic package.
python manage.py rqscheduler
python manage.py rqscheduler --queue default --interval 60
Requires django-rq and rq-scheduler to be installed.