django 乱码 汉语支持

来源:互联网 发布:云编程 编辑:程序博客网 时间:2024/04/30 13:34
SyntaxError at /depotapp/product/create/


Non-ASCII character '\xe4' in file /usr/app/workspace/depot/depotapp/forms.py on line 22, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details (forms.py, line 22)


Request Method: GET
Request URL: http://127.0.0.1:8000/depotapp/product/create/
Django Version: 1.6.8
Exception Type: SyntaxError
Exception Value:


Non-ASCII character '\xe4' in file /usr/app/workspace/depot/depotapp/forms.py on line 22, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details (forms.py, line 22)


Exception Location: /usr/app/workspace/depot/depotapp/views.py in 


解决方法1:

字符编码问题。修改相应的模块,添加 #coding: utf8    该项注释项

0 0
原创粉丝点击