【学习】Django mysql配置报错 Did you install mysqlclient?

最近在系统的学习Python3,参考 http://c.biancheng.net/view/7484.html

遇到问题1:

Did you install mysqlclient?

解决方案:安装pymysql,并在_init_.py中添加如下代码:

import pymysql
pymysql.install_as_MySQLdb()

遇到问题2:

django mysql AttributeError: 'str' object has no attribute 'decode'

解决方案:

参考:

https://blog.csdn.net/qq_52385631/article/details/122945179

posted @ 2023-01-31 15:53  虹梦未来  阅读(21)  评论(0编辑  收藏  举报  来源