django disable foreign key checks temporary

  1. Edit the settings file of your Django project.
  2. Locate the DATABASES dictionary within the settings file.
  3. Under the relevant database engine settings, add 'OPTIONS': {'init_command': 'SET foreign_key_checks = 0'}.
  4. Save the changes to the settings file.
  5. Restart your Django application to apply the changes.