Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django odbc connection to production SQL server 2014 from windows machine #166

Closed
AliSajah opened this issue Sep 24, 2018 · 1 comment
Closed

Comments

@AliSajah
Copy link

I have build a django project on windows 10 which i want to connect to a production SQL server however am getting the errors below when running the migrate.

Below is my database settings;

DATABASES = {

'default': {
'ENGINE': "sql_server.pyodbc",
'HOST': "127.0.0.1",
'PORT': '1433',
'USER': "student",
'PASSWORD': "XXXXXXX",
'NAME': "database_name",
'OPTIONS': {
'driver': 'ODBC Driver 13 for SQL Server',
'unicode_results': True,

    },

}

}

I have the following lib installed;
Django==2.1.1
django-crispy-forms==1.7.2
django-mssql==1.8
django-pyodbc==1.1.3
django-pyodbc-azure==2.1.0.0
anaconda-client==1.6.0
anaconda-navigator==1.5
anaconda-project==0.4.1

Below are a the errors its throwing when i run the migrate.

File "C:\Python36\lib\site-packages\django\db\utils.py", line 89, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "C:\Python36\lib\site-packages\django\db\backends\base\base.py", line 216, in ensure_connection
self.connect()
File "C:\Python36\lib\site-packages\django\db\backends\base\base.py", line 194, in connect
self.connection = self.get_new_connection(conn_params)
File "C:\Python36\lib\site-packages\sql_server\pyodbc\base.py", line 307, in get_new_connection
timeout=timeout)
django.db.utils.InterfaceError: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')

Need help on how to go about fixing this issue.Other databases are not an option only SQL SERVER

@dlo
Copy link
Member

dlo commented Sep 24, 2018

Dupe of #46.

As I mentioned in the previous issue you commented on, please ask this on StackOverflow and post question URL in a follow-up comment.

@dlo dlo closed this as completed Sep 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants