django app 加载报错AppRegistryNotReady

来源:互联网 发布:java获取时间戳时分秒 编辑:程序博客网 时间:2024/05/19 12:41

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.

解决办法:

application = django.core.handlers.wsgi.WSGIHandler()

换成如下

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

0 0
原创粉丝点击