Django: Removing duplicated data in model

I am getting a data directly from an API and store it in list in dictionary format and then loads the data into the database , but whenever i open that page the data gets duplicated even tho i am clearing the list.

You probably need to take a step back and see if you really want to save all that data in the DB on every iteration? Maybe there are a few values which needs to be saved for your processing and rest don't. What are you trying to achieve here, what is your logic?

Back to Top