I have a Django site that runs on PostgreSQL, and I'm trying to extract some data from SQL Server to populate some form fields.
I can connect to SQL Server and query the database from a Linux server using Python with pyodbc and FreeTDS, and I got the impression that I can use the same connection string in the django view, but when I tried, I got the following error:
('01000', "[01000] [unixODBC] [Driver Manager] Unable to open lib '/path/to/libtdsodbc.so': file not found (0) (SQLDriverConnect)")
I tried changing permissions for files and folders, but it didn’t bother me, as I said, I can connect via Python, but not with Django.
I can also connect from the command line in the django application folder using
manage.py shell
Any help is greatly appreciated.
UPDATE:
The file definitely exists, and Django and Python use the same ODBC and FreeTDS configuration files.
I do not use virtualenv.
I saw several links to /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so when I was doing the initial setup, but I got the impression that any problems that this could solve would not allow python to connect, not is not it?
UPDATE 2:
I tried using pymssql and I get similar results, it works through Python, but with Django I get this ImportError:
libct.so.4: cannot open shared objects file: no such file or directory
UPDATE - SOLVED
@ bradley.ayers comment in PIL - libjpeg.so.8: cannot open shared objects file: such a file or directory did not point me in the right direction.