Normally I use my own indexing when looping through list (or any sequence type) as in other languages. In python you can use enumerate function for the same.
Django framework is designed for novice users in mind and so they try to keep things simple at the cost of performance. Once such is the Django model’s save method. Every save fires first a SELECT statement to verify if a record exists with the provided “id” and then does update if exists else insert. As a good framework django does provide the flexibility to control this. You can pass the force_update=True to save method if you know for sure that the id exists already and the call to django model save avoids the SELECT sql before insert.
Same goes for insert too. You set the force_insert=True in that case.
If you find your program is leaking memory when using Django model then it is most probably because you are in running in debug mode. Django keeps track of the sql statement generated by the model save in debug mode which tends to be the reason behind leak. It is not a problem unless you are in tight memory scenario which are normally enforced by hosting providers like webfaction. I learnt of this in a hard way but Django doc does mention this. See here