[Answer]-IntegrityError #1062 in django.db.utils – Duplicate entry for key 2

1👍

Try and insert data using the error handle mechanism:-

from django.db.utils import DatabaseError,IntegrityError

Then do something like this to prevent your python script to stop :-

 try:
  #write code to execute query here
except IntegrityError:
   #write code to handle exception here(example creating a log)

Leave a comment