Avoiding duplicate objects in Django querysets

Avoiding PostgreSQL Pitfalls: The Hidden Cost of Failing Inserts