python和django中的常见错误
生活随笔
收集整理的這篇文章主要介紹了
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")
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/archive/2013/06/15/3132816.html
總結
以上是生活随笔為你收集整理的python和django中的常见错误的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 一、字符测试
- 下一篇: 这几天有django和python做了一