python和django中的常见错误

int() argument must be a string or a number, not 'tuple'


Error in formatting: coercing to Unicode: need string or buffer, int found



Data truncated for column 'content' at row 1

sql语句中单引号的设置
字段类型
字段长度


'ascii' codec can't decode byte 0xe7 in position 0: ordinal not in range(128)
在函数中出现中文的话会出现这个错误,简单的办法就是给编码
如:
"我的博客".decode("utf-8")





原文地址:https://www.cnblogs.com/djangochina/p/3132816.html