在为我当前的django项目进行迁移时遇到错误 .

下面是在settings.py文件中编写的代码,用于连接到MSSQL Server .

DATABASES = {
'default': {
    'ENGINE':'sql_server.pyodbc',
    'NAME':'JTPROD',
    'HOST':'TZACL5X8H1N2\SQLEXPRESS', ##this is my local machine database
    'USER':'xxx', ##ommitted for the post 
    'PASSWORD':'xxx',##ommitted for tht post
    'PORT':'',

    'OPTIONS':{
        'provider': 'SQLOLEDB', # Have also tried 'SQLCLI11' and 'SQLCLI10'
        'extra_params': 'DataTypeCompatibility=80',
        'driver':'SQL Server',
             },
    },
}

but am getting the following error when I run "python manage.py migrate

Traceback(最近一次调用最后一次):文件“C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ db \ backends \ base \ base.py”,line 216,在ensure_connection中self.connect()文件“C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ db \ backends \ base \ base.py”,line 194,在连接self.connection = self.get_new_connection(conn_params)文件“C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ sql_server \ pyodbc \ base.py”,第307行,在get_new_connection中超时=超时)pyodbc.OperationalError:('08001','[08001] [Microsoft] [ODBC SQL Server驱动程序]既不提供DSN也不提供SERVER关键字(0)(SQLDriverConnect); [08001] [Microsoft] [ODBC SQL Server驱动程序]无效的连接字符串属性(0)')

上述异常是以下异常的直接原因:

Traceback(最近一次调用最后一次):文件“manage.py”,第15行,在execute_from_command_line(sys.argv)文件“C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site -packages \ django \ core \ management__init __ . py“,第381行,在execute_from_command_line utility.execute()文件”C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ core \ management__init __ . py“,第375行,执行self.fetch_command(子命令).run_from_argv(self.argv)文件”C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site -packages \ django \ core \ management \ base.py“,第316行,在run_from_argv self.execute(* args,** cmd_options)文件”C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ core \ management \ base.py“,第353行,执行输出= self.handle(* args,** options)文件”C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ core \ management \ base.py“,第83行,包装res = handle_func(* args,** kwa) rgs)文件“C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ core \ management \ commands \ migrate.py”,第82行,在句柄 Actuator 中= MigrationExecutor (connection,self.migration_progress_callback)文件“C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ db \ migrations \ executor.py”,第18行,在init中self.loader = MigrationLoader(self.connection)文件“C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ db \ migrations \ loader.py”,第49行,在init self.build_graph()文件“C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ db \ migrations \ loader.py”,第212行, build_graph self.applied_migrations = recorder.applied_migrations()文件“C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ db \ migrations \ recorder.py”,第61行,在applied_migrations中,如果self.has_table():文件“C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ l ib \ site-packages \ django \ db \ migrations \ _recictor.py“,第44行,在has_table中返回self.connection.introspection.table_names中的self.Migration._meta.db_table(self.connection.cursor())文件”C :\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ db \ backends \ base \ base.py“,第255行,在游标中返回self._cursor()文件” C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ db \ backends \ base \ base.py“,第232行,in _cursor self.ensure_connection()文件” C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ db \ backends \ base \ base.py“,第216行,在ensure_connection self.connect()文件中” C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ db \ utils.py“,第89行,在退出时从exc_value文件中提取dj_exc_value.with_traceback(traceback)” C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ db \ backends \ base \ base.py“,第216行,在ensure_connection中self.connect()文件“C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ django \ db \ backends \ base \ base.py”,第194行,在连接中self.connection = self.get_new_connection(conn_params)文件“C:\ Users \ elukamis \ AppData \ Local \ Programs \ Python \ Python37-32 \ lib \ site-packages \ sql_server \ pyodbc \ base.py”,第307行, get_new_connection timeout = timeout)django.db.utils.OperationalError:('08001','[08001] [Microsoft] [ODBC SQL Server驱动程序]既不提供DSN也不提供SERVER关键字(0)(SQLDriverConnect); [08001] [Microsoft] [ODBC SQL Server驱动程序]无效的连接字符串属性(0)')

Does anyone have an idea on what I might be missing in my configuration ?