wmoskal
wmoskal

Reputation: 295

django pyodbc Data Source Name not found

When Attempting to connect to my database server and database in Django, I am getting the error (django.db.utils.InterfaceError: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)'), and I am not sure why

settings.py
DATABASES = {
    'default': {
        'ENGINE': 'sql_server.pyodbc',
        'NAME': 'MY_DATABASE_NAME',
        'HOST': '13.0.4001.0',
        'USER': 'MY_USERNAME',
        'PASSWORD': 'MY_PASSWORD',
        'CONN_MAX_AGE': 1000,
        'PORT': '8000',
        'OPTIONS': {
            'driver': 'ODBC Driver 13 for SQL Server',
        }
    },
}

How would I fix this error, and start getting/editing data from my database

Upvotes: 2

Views: 606

Answers (1)

Gustavo dos S. Morato
Gustavo dos S. Morato

Reputation: 26

hi check the version of your SQL server and try download of drive connector , I was the same problem then i install the driver ODBC 17 and the problem was solved.

Drive SQL

Upvotes: 1

Related Questions