Python3.6 用Django连接MySQL

Python3.6 用Django连接MySQL一直报错django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11.None
百度好久没解决 ,不知道在哪看到了一个解决方法 贴出来。
错误

django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11.None

通过查找路径C:\Programs\Python\Python36-32\Lib\site-packages\Django-2.0-py3.6.egg\django\db\backends\mysql
这个路径里的文件把

if version < (1, 3, 3):
     raise ImproperlyConfigured("mysqlclient 1.3.3 or newer is required; you have %s" % Database.__version__) 

注释掉 就行了

1.先设置setting.py里面的配置
2.安装python的mysql驱动
3.到站点下的init文件加载
import pymysql
pymysql.install_as_MySQLdb()

posted @ 2017-06-29 18:08  我的大金金  阅读(970)  评论(0编辑  收藏  举报