尝试将Django连接到Micro软服务器时发生错误-错误为:没有名为“ sql_server”的模块

时间:2019-05-20 20:16:19

标签: python django

我正在尝试将Django连接到远程Microsoft Server,但始终出现以下错误:

我已经安装了以下内容: Django的MSSQL pyodbc Django-pyodbc django-pyodbc-azure

django.core.exceptions.ImproperlyConfigured: 'sql_server.pyodbc' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
    'mysql', 'oracle', 'postgresql', 'sqlite3'
Error was: No module named 'sql_server'


DATABASES = {
'default': {
    'ENGINE': 'sql_server.pyodbc',
    'OPTIONS':{
        "driver": "FreeTDS",
        "extra_params": "tds_version=7.3",
    },
    'NAME': 'db_name',
    'USER': 'user_name',
    'PASSWORD': 'password',
    'HOST': 'host_address',
    'PORT': '1433'
}

}

0 个答案:

没有答案