现在的位置: 首页 > 综合 > 正文

django.core.exceptions.ImproperlyConfigured: ‘mysql’ isn’t an available database backend.

2013年01月02日 ⁄ 综合 ⁄ 共 634字 ⁄ 字号 评论关闭

django连接mysql发生错误:django.core.exceptions.ImproperlyConfigured: 'mysql' isn't an available database backend.

需要修改两个setting.py文件 

项目根目录和下一层目录各一个。

DATABASE修改如下

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql', #'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'dtest',                      # Or path to database file if using sqlite3.
        'USER': 'root',                      # Not used with sqlite3.
        'PASSWORD': 'password',                  # Not used with sqlite3.
        'HOST': 'localhost',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '3306',                      # Set to empty string for default. Not used with sqlite3.
    }
}

抱歉!评论已关闭.