django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0....

Django2.2x, Python3.6在migrate时出现以下问题:
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.

网上流行注释掉两行,还是不行,另外总觉得去改设置文件也不是个好的习惯,继续找路,发现:

As per this pull request, The problem is not only the version number of mysqlclient. As per this ticket #30380, there may be many places in django where support for PyMySQL could be broken, and Django will not fix them(probably). Also, as per tickets #12500, #22391, Django does not support PyMySQL officially.

所以用mysqlclient取代pymysql:

  1. 删除项目__init__.pypymysql的设置
  2. pip install mysqlclient
  3. 搞定!

进一步可以参考这里:https://stackoverflow.com/questions/55472739/have-a-problem-using-django-2-2-with-pymysql

你可能感兴趣的:(django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0....)