django报错:django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you install mysqlclient?

django 迁移数据库报错

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?

解决方案:在settings.py同级目录中的__init__.py文件中加入:

import pymysql
pymysql.install_as_MySQLdb()
posted @ 2019-12-15 17:05  腹肌猿  阅读(360)  评论(0编辑  收藏  举报