Django ERRORS(translation.E004) 问题解决

使用Django的admin本地化配置时遇到

ERRORS:
?: (translation.E004) You have provided a value for the LANGUAGE_CODE setting that is not in the LANGUAGES setting.

2.X版本没有出现异常,当前Django版本

Django ERRORS(translation.E004) 问题解决

添加相应的LANGUAGES

解决方法:

from django.utils.translation import gettext_lazy as _
LANGUAGES = [
('zh-Hans', _('Simplified Chinese')),
]

LANGUAGE_CODE = 'zh-Hans'

 

上一篇:Go 错误处理总结与实践


下一篇:成功解决pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 49, saw 2