Building our Django project, when updating the production site, we got this error on the log: Error was: ‘str’ object has no attribute ‘_default_manager’

I was puzzled because on the others sites with the same exact code (using git here), the project worked flawless. We tried using fresh databases, desactivating the django’s admin site, etc.

The problem got solved when I deleted some *.pyc from two of he apps used, specially the one used for the authenticaion. So…remember: If you get some strange error, try deleting those *.pyc!

PD: The error happened again. This time, I got solved it by entering this code before admin.autodiscover() from the main urls.py:

from django.db.models.loading import cache as model_cache
if not model_cache.loaded:
    model_cache.get_models()

I got the solution from here: http://code.djangoproject.com/ticket/10405#comment:10

It’s just a workaround. Hope it works for you!

Anuncios