How to config Django using pymysql as driver?

前端 未结 2 1348
遥遥无期
遥遥无期 2020-12-08 05:25

I\'m new to Django. It wasted me whole afternoon to config the MySQL engine. I am very confused about the database engine and the database driver. Is the engine

2条回答
  •  無奈伤痛
    2020-12-08 05:51

    You can import pymsql so it presents as MySQLdb. You'll need to do this before any django code is run, so put this in your manage.py file

    import pymysql
    pymysql.install_as_MySQLdb()
    

提交回复
热议问题