Django отключите проверку иностранных ключей временно
from django.db import connection
with connection.constraint_checks_disabled():
do_stuff()
Salik Sheraz
from django.db import connection
with connection.constraint_checks_disabled():
do_stuff()