Handling PostgreSQL Integrity Errors in Django

I have some basic Django code that attempts to insert a new record into a PostgreSQL database. It’s wrapped in a try/except statement in case a unique constraint is violated, in which case I’ll typically ignore it and move on.
So the general pattern is:
from django.db import IntegrityError
import models
try:
myNewRecord = models.MyTable(data=blah)
[...]

Enabling Implicit Cast From Integer To Boolean in PostgreSQL

I’ve been using MySQL for a while with my pet projects, but recently I’ve been writing some more complicated queries, and I’m running into a few obnoxious limitations, mostly involving known view performance problems. I’ve decided to start testing the waters in PostgreSQL, so I tried importing my data into PG by running a MySQL-generated [...]