Answer the question
In order to leave comments, you need to log in
How to write a table to the django database, not a row?
There is a table, approximately 150 lines. If you pass it to the model line by line, then writing takes a very long time, and this action must be done once every 10 seconds. In this regard, I think how to transfer the entire table at once, and not line by line. What are the solutions?
Answer the question
In order to leave comments, you need to log in
For starters, I would try bulk_create , dividing these 150k into chunks of a certain (experimentally determined) size. In general, specify the task, please. It is not very clear why you need to write 150k lines to the database every 10 seconds.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question