I am trying to migrate our current website to django 1.7.

Currently we are using a plugin called django-dbgettext to get parts of our
database translated (we are running in 10 different languages). The problem
is that django-dbgettext starts by going through all of the models and does
this before the translation framework is running. So I get an exception
during startup that says:
"django.core.exceptions.AppRegistryNotReady: The translation infrastructure
cannot be initialized before the apps registry is ready. Check that you
don't make non-lazy gettext calls at import time."

The problem seems to be that the classes are loaded before the models are
correctly loaded and the translation framework is running. All of the
classes use ugettext_lazy, but the stack trace includes ugettext.

I want to rewrite the django-dbgettext plugin so that it goes through the
code AFTER the models are correctly loaded. I don't know how to do this
however. Is there anyway of running code after django is fully initialized?

Django admin should do the same thing, it also has a autodiscover()
function and I was wondering why this doesn't happen with django admin?
Could this be a good place to start looking for a solution?

Regards,

Andréas

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALXYUbm6tMZC-Oc5UhJ5xaZ6uxWpKdw4evBp_P%2BoVhtjuLGY_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to