django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

前端 未结 23 1273
夕颜
夕颜 2020-12-02 10:51

The problem Im facing while trying to connect to database for mysql. I have also given the database settings that i have used.

 Traceback (most recent call l         


        
23条回答
  •  没有蜡笔的小新
    2020-12-02 11:19

    I was having the same problem.The following solved my issue

    Run pip install pymysql in your shell

    Then, edit the init.py file in your project origin directory(the same as settings.py) and then

    add:

    import pymysql

    pymysql.install_as_MySQLdb()

    this should solve the problem.

提交回复
热议问题