Problem connecting MySQL in Python 3.4

4

I just installed my virtual environment, I installed PyMysql and created a project, but when trying to start a python manage.py startapp nome APP, the following problem occurred:

Error loading MySQLdb module: No module named 'MySQLdb'

How can I configure MySQL and resolve this?

My settings.py :

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'meudb',
        'USER': 'root',
        'PASSWORD': '123',
        'HOST': 'localhost',
    }
}
    
asked by anonymous 29.09.2015 / 04:37

2 answers

1

For django to communicate with MySQL, you need to install an additional library in the environment in which you are using it. In addition, this library must be compatible with the Django engine, which is not the case for PyMySQL.

According to official documentation , you have 3 options:

29.09.2015 / 07:26
0

You should install mysql-python: pip install mysql-python

    
18.10.2015 / 23:30