I have created this custom management command in a Django application, to delete all but one record in a database table:
from django.core.management.base impo