I received a primary key violation from a race condition in middleware.py when used in production, resulting in a server error. This should fix it by using get_or_create to make the Visitor object database operation atomic. Hope it helps.
There's a fair few threads discussing if this is the case e.g. on StackOverflow  and GitHub . It's not atomic - sorry for previous claim - but it does simplify the django-tracking code and makes use of the most appropriate Django API for this purpose, in lieu of an UPSERT-type method which would be better.
In practical terms, get_or_create encloses the operation within a transaction which does a rollback if the object already exists , using the unique_together constraint in models.py. This keeps the database in a consistent state and seems to fix the error I was getting ('There was a problem saving visitor information', middleware.py line 154, version 0.4.1), which also generates an internal server error and a 'database error: current transaction is aborted'.
If you have any ideas on how else to fix this problem I'd be happy to hear them, if you think my fix is inappropriate. Thanks!