【问题标题】:django-pyodbc: my odbc driver on my old machine worked but now I'm getting a error saying my driver "doesn't support modern datatime types"django-pyodbc:我的旧机器上的 odbc 驱动程序工作但现在我收到一个错误,说我的驱动程序“不支持现代数据时间类型”
【发布时间】:2019-08-08 19:56:41
【问题描述】:

我正在尝试在 Django 中开发一个应用程序。我最近买了一台新的工作机器,这是唯一改变的地方。

我的上一台计算机运行的是 Windows 7。服务器运行的是 Windows 7 企业版。我的新电脑运行的是 Windows 10 专业版。我的数据库正在 SQL Server 2012 中运行。

我正在使用django-pyodbc-azure 包。

错误:

django.core.exceptions.ImproperlyConfigured: The database driver doesn't support modern datatime types.

这是我的数据库设置:

DATABASES = {
    'default': {
        'NAME': 'auth',
        'HOST': 'x.x.x.x',
        'PORT': '',
        'ENGINE': 'sql_server.pyodbc',
        'OPTIONS': {
            'driver': 'SQL Server Native Client 11.0',
         },
    },
    'EZCORP': {
        'NAME': 'database',
        'HOST': 'x.x.x.',
        'PORT': '',
        'ENGINE': 'sql_server.pyodbc',
        'OPTIONS': {
            'driver': 'SQL Server Native Client 11.0',
            'dsn': 'mydsn',
        },
    },
}

【问题讨论】:

    标签: python sql-server django odbc


    【解决方案1】:

    问题出在计算机上设置的 ODBC 连接上。我需要下载正确的驱动程序(SQL Server Native Client 11.0)并创建 ODBC 连接使用该 odbc 驱动程序。然后一切正常!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-11-29
      • 1970-01-01
      • 2013-09-06
      • 1970-01-01
      • 2022-06-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多