解决报错:from err django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you install mysqlclient?
前言
使用python manage.py makemigrations
时出现报错:
from err django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you install mysqlclient?
解决办法
安装pymysql
pip install pymysql
在__init__.py中加入如下代码
import pymysql
pymysql.install_as_MySQLdb()