AppRegistryNotReady: The translation infrastructure cannot be initialized AppRegistryNotReady: The translation infrastructure cannot be initialized django django

AppRegistryNotReady: The translation infrastructure cannot be initialized


I faced the same error. Following worked for me.In your wsgi file change the last line to :

from django.core.wsgi import get_wsgi_applicationapplication = get_wsgi_application()

This have been changed since Django 1.6 to newer version.Here is the post that helped to deploy the django app.

If you want to use Nginx as webserver to deploy django app follow this post.


This is an answer for the less clever ones (like me): Be sure to check the obvious: The error message says: ... Check that you don't make non-lazy gettext calls at import time. So, if you use django's translation in the verbose_name of a model field or on any other part that is evaluated at import time, you need to use the *_lazy version. If not, you'll end up with the error the OP had.

I basically had:

from django.db import modelsfrom django.utils.translation import gettext as _import datetime# other thingsclass myModle(models.Model):    date = models.DateField(_('Date'), default=datetime.date.today)    # other defs. and things

And got the same error as the OP, but my wsgi config was fine.

All I had to do was replacing gettext with gettext_lazy (or ugettext with ugettext_lazy) and everything was fine.


@hellsgate solution worked for me.

Specifically from the link referenced by @hellsgate, I changed:

module = django.core.handlers.wsgi:WSGIHandler()

to

module = django.core.wsgi:get_wsgi_application()

in my vassals.ini file