其他分享
首页 > 其他分享> > django中文问题

django中文问题

作者:互联网

 

在编辑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'

 

标签:LANGUAGES,中文,CODE,zh,LANGUAGE,django,问题,setting,Hans
来源: https://www.cnblogs.com/sad-dog/p/12645030.html