Django报错:AttributeError: 'str' object has no attribute 'decode'

使用Django2.x版本之后时,使用pymysql踩的一些坑

 

执行迁移命令之后出现报错

 

AttributeError: ‘str‘ object has no attribute ‘decode‘

 

Django报错:AttributeError: 'str' object has no attribute 'decode'

 

 

 

解决方案

 

1、找到python安装目录下的django文件夹下的operations.py

 

Django报错:AttributeError: 'str' object has no attribute 'decode'

 

 

2 将decode修改成encode

Django报错:AttributeError: 'str' object has no attribute 'decode'

 

Django报错:AttributeError: 'str' object has no attribute 'decode'

上一篇:padding magin


下一篇:"小说阅读神器"App-隐私政策