1.APP未註冊mysql
INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'crm', #這裏未註冊會報錯:ImportError: No module named ‘MySQLdb' ]
2.對應項目下:__init__.pysql
import pymysql pymysql.install_as_MySQLdb()