1👍
✅
You have unique=True in your Dataset model for image field. This means you cannot assign one image to different Dataset instances. But you are doing in it in your index. In your index you trying to create a new dataset for every image every time. But if the Dataset with this image already created – you will get this ‘column image_id is not unique’ error. Please review your application logic and either remove unique=True or rewrite the behavior.
Source:stackexchange.com