#24872: dbshell don't read parameters correctly with sql_server.pyodbc (django-
pyodbc-azure)
-------------------------------------+-------------------------------------
     Reporter:  netamego             |      Owner:  nobody
         Type:  Uncategorized        |     Status:  new
    Component:  Core (Management     |    Version:  1.8
  commands)                          |   Keywords:
     Severity:  Normal               |  dbshell,sql_server.pyodbc
 Triage Stage:  Unreviewed           |  Has patch:  0
Easy pickings:  0                    |      UI/UX:  0
-------------------------------------+-------------------------------------
 The next connection:

 {{{

     '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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.17e1822c98b8fef7dfcfdfe6655606e7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to