django项目添加utf-8编码支持中文

代码中出现中文会报错:

Non-ASCII character '...' in file ......models.py on line ......., but no encoding declared;

 

只需在用了中文的文件里加一句:

# _*_ coding: utf-8 _*_

 

转载于:https://www.cnblogs.com/liulangmao/p/9724802.html

你可能感兴趣的:(python,数据库)