欢迎来到ZeroAO的博客

竹杖芒鞋轻胜马,谁怕?一蓑烟雨任平生。
扩大
缩小

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'

 

posted on 2020-04-06 20:54  Zeroao  阅读(217)  评论(0编辑  收藏  举报

导航

Live2D