Error 502 bad gateway in Django admin when deleting nomenklatur more than 100, how to fix?

0 like 0 dislike
146 views
You need to remove 10 thousand items, only items 6 million as I understand it somewhere in the server settings is timut the connection and need to increase it only where to look in the settings of Nginx or django?
by | 146 views

3 Answers

0 like 0 dislike
Deleting 10K records in Django admin generates a list page of these records and all associated with them "are you sure you want to delete everything". It may take years :)
The solution is to write your admin action to remove what you need, preferably without the use of DeleteCollector-and do (he, too, object to memory collects before deleting)
by
0 like 0 dislike
Make customvue Wuhu/management_command/task/action or what have you, and there inside a single transaction remove items.
It is advisable to remove cascading of children and other related objects and then the objects themselves. To remove it is best just using a queryset.delete().

You can still use raw_delete, but it will be more difficult for you
by
0 like 0 dislike
Can go to shell there to do it?
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
0 comments
40,796 users