在编辑admin中文语言时遇到
ERRORS:
?: (translation.E004) You have provided a value for the LANGUAGE_CODE setting that is not in the LANGUAGES setting.
查了才了解到django3.0开始需配置如下:
from django.utils.translation import gettext_lazy as _ LANGUAGES = [ ('zh-Hans', _('Chinese')), ] LANGUAGE_CODE = 'zh-Hans' TIME_ZONE = 'Asia/Shanghai'