django编写过程中,模板继承出现'utf-8' codec can't decode byte 0xc4 in position 75: invalid continuation byte

django编写代码过程中

模板可能有些包含中文字符

首先要在setting中设置

LANGUAGE_CODE = 'zh-cn'

TIME_ZONE = 'Asia/Shanghai'

FILE_CHARSET='gb18030'

DEFAULT_CHARSET='utf-8'

 

然后在每个模板开头都要有

<!DOCTYPE html>

<html>

扫描二维码关注公众号,回复: 5357376 查看本文章

<meta charset="utf-8">

不然会报

'utf-8' codec can't decode byte 0xc4 in position 75: invalid continuation byte

猜你喜欢

转载自www.cnblogs.com/yanwuyigu/p/10451045.html