Django duplicates the data sent to MongoDB in the first run

Hello everyone,

I will not share the code because it is unnecessary for now. The thing is, when I first run ‘python runserver’ command, my code uploads a file to MongoDB but twice. And when I Control+C and stop the server and rerun it again, it sends the file just once. What is the reason for that, is it a bug or something? Thanks in advance.