Sunday, January 19, 2014

Re: Connecting to a MS SQL server from django

Larry,

We tried django-mssql and gave up.  Much better luck with
django-pyodbc.  We use the avidal version of it, along with pyodbc,
FreeTDS, and unixODBC.  Works perfectly.  If you like, I can dig up
my notes on exactly how we made the connection from Django to
MS SQL Server.

--Fred
Fred Stluka -- mailto:fred@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.

On 1/14/14 6:15 PM, Larry Martell wrote:
I am trying to connect to a MS SQL server from django on Linux using  Vernon Cole's django-mssql package  (https://bitbucket.org/vernondcole/django-mssql-ado-merge/src).    When I first tried to connect it failed with:    Exception Type: DatabaseError at /report/CDSEM/EventsTable/  Exception Value: Cannot create connection  to=PYRO:ado.connection@xx.xx.xx.xx:9099    I traced it through  /usr/lib/python2.6/site-packages/adodbapi/remote.py and I see it tries  to access os.environ['PROXY_PORT'], which is not defined and then it  defaults to 9099 - Is that the correct port or should I set  os.environ['PROXY_PORT']? How can I tell what port MS SQL db is  listening on? I googled this and it said the default MS SQL port is  1433. I set os.environ['PROXY_PORT'] to that and now I don't get that  error but it times out:    
/usr/lib/python2.6/site-packages/Pyro4-4.22-py2.6.egg/Pyro4/core.py(160)__call__()  
-> return self.__send(self.__name, args, kwargs)  (Pdb) n  TimeoutError: TimeoutE...imeout',)    I tried opening port 1433 with iptables, but still no joy.    I can connect to the MS SQL db locally from the host it's running so I  know it's up and my credentials are correct, and I can ping the  Windows box from the Linux host I am running on, so I know there is  connectivity to it from there.    Anyone here ever get this working? Anyone have any ideas as to what my  problem is or how I can debug this further?    Thanks!  -larry    

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate