Python full stack (ten) Django framework 5. Native SQL statement usage and ORM introduction

One, Django connects to the database

1. Install MySQL driver

When using Django to operate MySQL, the bottom layer is still operated through Python, so if you want to use Django to operate MySQL, you first need to install a driver.
In Python3, there are many choices of drivers, including pymysql, mysqlclient, etc.
Choose mysqlclient here, and pip install mysqlclientyou can install it directly by using the command . If the installation fails, please refer to https://blog.csdn.net/CUFEECR/article/

Guess you like

Origin blog.csdn.net/CUFEECR/article/details/108541100