django3.0显示中文提示错误
ERRORS:
?: (translation.E004) You have provided a value for the LANGUAGE_CODE setting that is not in the LANGUAGES setting.
参考:https://www.cnblogs.com/dhcn/p/12038629.html
处理方法:
LANGUAGES = [
('zh-Hans', _('Chinese')),
]
LANGUAGE_CODE = 'zh-Hans'
提示错误:
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "D:\zhi\test1\test1\settings.py", line 108, in <module>
('zh-Hans', _('Chinese')),
NameError: name '_' is not defined
正确方法:
LANGUAGES = [
('zh-Hans', ('Chinese')),
]
LANGUAGE_CODE = 'zh-Hans'