Django and mysql problems on Mavericks

前端 未结 1 660
无人及你
无人及你 2020-12-18 23:39

I\'m running Mac OSX 10.9 Mavericks. I\'m trying to run django under python 3. Because I\'m running Python 3 I have to get the official connector from the mysql devs here ga

1条回答
  •  时光说笑
    2020-12-19 00:22

    For python 2.7, 3.3+ there is a driver called mysqlclient that works with django 1.8

    pip install mysqlclient
    

    And in your settings

    DATABASES = {
        'default': {
            'NAME': '',
            'ENGINE': 'django.db.backends.mysql',
            'USER': '',
            'PASSWORD': '',      
        }
    }
    

    Here's the official django documentation about the mysql drivers:

    https://docs.djangoproject.com/en/1.8/ref/databases/#mysql-db-api-drivers

    0 讨论(0)
提交回复
热议问题