I\'m at wit\'s end. After a dozen hours of troubleshooting, probably more, I thought I was finally in business, but then I got:
Model class django.contrib.co
I had exactly the same error when running tests with PyCharm. I've fixed it by explicitly setting DJANGO_SETTINGS_MODULE environment variable. If you're using PyCharm, just hit Edit Configurations button and choose Environment Variables.
Set the variable to your_project_name.settings and that should fix the thing.
It seems like this error occurs, because PyCharm runs tests with its own manage.py.