您的位置:首页 > 编程语言 > Python开发

python-->django使用过程中碰到的异常总结

2015-08-24 21:24 645 查看
1.

SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xa1 in position 0:

invalid start byte:

这是因为代码中有中文字符,在网上搜了一下,可以用 u("中文").encode("utf-8")

或者 unicode(“中文”).encode("utf-8")来解决,

为了简单起见,先直接简单粗暴,干掉中文。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python--django异常