我正在研究一个Django项目,当我尝试运行任何管理命令时会出现此错误,例如:
python manage.py validate --settings ord.settings.development,python manage.py syncdb --settings ord.settings.development.该项目使用Django 1.5的错误是:AttributeError: 'Nonetype' object has no attribute '_info'.没有给出其他输出.
项目基础设置文件是:https://gist.github.com/anonymous/5c0fede63b2724d7880b
开发设置:https://gist.github.com/anonymous/f60b90dcf573b0a7b920
我用的是替换了敏感设置 x
知道什么可能是错的吗?
一些额外的信息,当我注释掉LANGUAGE_CODE的设置,一些命令一样validate,runserver,shell运行良好,但syncdb与migrate失败,错误:DatabaseError: current transaction is aborted, commands ignored until end of transaction block
mmr*_*151 16
有同样的问题,
请按照以下步骤操作:
django/utils/translation/trans_real.pyres = _translation(globalpath)添加以下内容:
if res is None:
return gettext_module.NullTranslations()
Run Code Online (Sandbox Code Playgroud)来源:https://code.djangoproject.com/ticket/18192
在ubuntu 14.04上的新安装遇到了同样的问题.经过大量挖掘 - 以为我应该分享我的发现:我们正在使用django 1.5并且遇到了同样的错误.似乎django安装缺少文件夹django/conf/locale/en/LC_MESSAGES
解决方法是安装最新版本"pip install django == 1.5.12"