Fix for south migration. Copied from https://github.com/lubico-business/django-dynamicsites