安装PyMySQL:注意:命令中的PyMySQL是区分大小写的,不能写错。

pip install PyMySQL

Collecting PyMySQL
Downloading PyMySQL-1.0.2-py3-none-any.whl (43 kB)
|████████████████████████████████| 43 kB 457 kB/s
Installing collected packages: PyMySQL
Successfully installed PyMySQL-1.0.2

在seetings.py所在目录的__init__.py文件中添加:

import pymysql
pymysql.install_as_MySQLdb()

然后重新启动即可:

python manage.py runserver 0.0.0.0:8000

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
猜你喜欢
  • 2021-06-30
  • 2021-06-21
  • 2021-08-26
  • 2021-09-24
  • 2021-10-14
相关资源
相似解决方案