使用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版本
添加相应的LANGUAGES
解决方法:
from django.utils.translation import gettext_lazy as _ LANGUAGES = [ ('zh-Hans', _('Simplified Chinese')), ] LANGUAGE_CODE = 'zh-Hans'
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/20490.html