使用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'