microsoft/mssql-django

Can't connect to existing SQL database[QUESTION]

kevCurnow opened this issue · 2 comments

Question
I have been trying to connect to an existing database (hosted in SQLExpress), but I'm not sure I have everything set up properly. In my settings.py file, I've tried to write everything exactly as in the readme.

DATABASES = {
'default': {
'ENGINE': 'mssql',
'NAME': 'django_again',
'USER': 'django3',
'PASSWORD': 'password',
'HOST': 'KEVIN\SQLEXPRESS',
'PORT': '1433',
'OPTIONS': '',
},
}

However, when I try to run either of the migration commands, I receive the following error:
AttributeError: 'str' object has no attribute 'get'

If it matters at all, I was trying to follow along with this tutorial, but using mssql-django instead of sql_server.pyodbc.

I should note, I am working with Django 4.2.4. Any help would be greatly appreciated!

This is my first time learning django, and I'm not familiar with odbc. Do I still need to create a data source and connect to a driver even if my database/server are local? Because when I attempted to do so, I got an error when trying to make migrations that there was a login timeout

@kevCurnow did you manage to solve this?