'mssql' (also tried 'sql_server.pyodbc) isn't an available database backend or couldn't be imported

I have been all over the Internet and read, as well as tried, every post and solution I could find. I cannot find a way to connect to SQL Server 2019.

I have installed, uninstalled, reinstalled: mssql-django, django-pyodbc-azure, django-mssql-backend. I’ve tried using one, two and all three at the same time. Nothing works.

I feels like it should be so simple. Setting up and testing a project with a local installation of SQL Server using Windows Default login.

With pyodbc and mssql-django installed (my latest iteration):
settings.py

DATABASES = {
‘default’: {
‘ENGINE’: ‘mssql’,
‘NAME’: ‘mytestdb’,
‘HOST’: ‘thisPC-\MSSQLSERVER01’,
‘PORT’:‘’,
‘OPTIONS’: {
‘driver’: ‘ODBC Driver 17 for SQL Server’,
‘isolation_level’: ‘READ UNCOMMITTED’,
},
}
}…

when I run python manage.py makemigrations TestApp I get a host of errors:
…ModuleNotFoundError: No module named ‘mssql’…
…django.core.exceptions.ImproperlyConfigured: ‘mssql’ isn’t an available database backend or couldn’t be imported…

I don’t know what to try next. I’m at a loss for ideas.

Hey fabi66,

I’m running in the same issue. But for some reasons it works on my laptop, but doesnt work on the windows server.

Did you find the cause of your issue?

I did not find the answer. I continued exploring Django with other database platforms. But ultimately I need something that works seamlessly with SQL Server

Have you tried using mssql-django with settings:

DATABASES = {
    "default": {
        "ENGINE": "mssql",
        "NAME": "mytestdb",
        "HOST": "thisPC-\MSSQLSERVER01"
    }
}