How to config Django using pymysql as driver?

前端 未结 2 1354
遥遥无期
遥遥无期 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 06:05

    The short answer is no they are not the same.

    The engine, in a Django context, is in reference to RDBMS technology. The driver is the library developed to facilitate communication to that actual technology when up and running. Letting Django know what engine to use tells it how to translate the ORM functions from a backend perspective. The developer doesn't see a change in ORM code but Django will know how to convert those actions to a language the technology understands. The driver then takes those actions (e.g. selects, updates, deletes) and sends them over to a running instance to facilitate the action.

提交回复
热议问题