在使用主管和gunicorn部署Django应用程序时遇到了同样的问题。
解决的问题是将以下行添加到我的主管配置文件中:
environment=LANG="es_ES.utf8", LC_ALL="es_ES.UTF-8", LC_LANG="es_ES.UTF-8"
对于您的情况,请确保要打印的中文语言环境可用并已安装在Docker容器中。此博客描述了如何执行此操作:dockerfile示例(使用中文语言环境而不是en_CA.UTF-8):
FROM ubuntu:15.10MAINTAINER Mobify <ops@mobify.com>RUN apt-get -qq update && apt-get -q -y upgrade && apt-get install -y sudo curl wget locales && rm -rf /var/lib/apt/lists/*# Ensure that we always use UTF-8 and with Canadian English localeRUN locale-gen en_CA.UTF-8COPY ./default_locale /etc/default/localeRUN chmod 0755 /etc/default/localeENV LC_ALL=en_CA.UTF-8ENV LANG=en_CA.UTF-8ENV LANGUAGE=en_CA.UTF-8
希望这会引导您走向正确的方向。



