{{{
'BBDDSQL': {
'NAME': 'MyDatabase',
'ENGINE': 'sql_server.pyodbc',
'HOST': 'freetds_dsn_BBDD',
'USER': 'sa',
'PASSWORD': 'MyPassword',
'PORT': '49247',
'OPTIONS': {
'driver': 'FreeTDS',
'dns':'MyDns',
'MARS_Connection': True,
},
}
}}}
works like a charm inside Django views but fails with the next command:
python manage.py dbshell --database=BBDDSQL
with error:
{{{
[IM002][unixODBC][Driver Manager]Data source name not found, and no
default driver specified
[ISQL]ERROR: Could not SQLConnect
}}}
Command:
isql -v MyDns sa MyPassword
works perfect so I have enabled
{{{
[ODBC]
Trace=Yes
TraceFile=/tmp/odbc_u.log
}}}
in odbcinst.ini file and run
{{{
python manage.py dbshell --database=BBDDSQL
}}}
What I see in /tmp/odbc_u.log trace file is:
{{{
Server Name = [sa][length = 2 (SQL_NTS)]
User Name = [MyPassword][length = 9 (SQL_NTS)]
Authentication = [NULL]
}}}
So dbshell is not reading correctly parameters from settings.py when use
sql_server.pyodbc engine.
This error is in Django 1.7 and 1.8.
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/24872>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => needsinfo
* needs_tests: => 0
* needs_docs: => 0
Comment:
I believe it's an issue with the third-party driver (if it is a problem
with Django, there's not enough information for me to tell what it is). I
see you already [https://github.com/michiya/django-pyodbc-azure/issues/29
filed an issue] there. Please reopen if the investigation concludes that
it is a problem with Django.
--
Ticket URL: <https://code.djangoproject.com/ticket/24872#comment:1>