uWSGI: django.core.exceptions.AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready.

Автор: | 18/05/2015

uwsgiПосле обновления Django с 1.3 до 1.8 и uWSGI с 2.0.8 до 2.0.10 – при запуске приложения на Django возникает ошибка:

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.

Решение – изменить в настройках uWSGI :

[uwsgi]
socket = 127.0.0.1:9091
chdir = /var/www/django/money_domain_org_ua
pythonpath = /usr/local/lib/python2.7/site-packages/
module = django.core.handlers.wsgi:WSGIHandler()
env = DJANGO_SETTINGS_MODULE=money.settings
master = True
pidfile = /tmp/project-master.pid
daemonize=/var/log/uwsgi/money.domain.org.ua.log
plugins = python
uid = setevoy
gid = setevoy

Параметр:

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

на:

module = django.core.wsgi:get_wsgi_application()