I have a Django site that is running on PostgreSQL and I'm attempting to pull some data from SQL Server in order to populate some form fields.
I can connect to the SQL Server and query the database from the Linux server using Python with pyodbc and FreeTDS and I was under the impression that I could use the same connection string in the django view but when I tried I got the following error:
('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/path/to/libtdsodbc.so' : file not found (0) (SQLDriverConnect)")
I've tried changing file and folder permissions but it's not got me anywhere, like I say I can connect via Python but not with Django.
I can also connect from the command line in the django applications folder using
manage.py shell
Any help is greatly appreciated.
UPDATE:
The file definitely exists, both Django and Python are using the same ODBC and FreeTDS config files.
I don't use virtualenv.
I did see a few references to /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
when I was performing the initial set up but I was under the impression that any issues that this could solve would prevent python from connecting also, would this not be the case?
UPDATE 2:
I've tried using pymssql and I'm getting similar results, it works through Python but with Django I'm getting this ImportError:
libct.so.4: cannot open shared object file: No such file or directory
UPDATE - SOLVED
@bradley.ayers comment in PIL - libjpeg.so.8: cannot open shared object file: No such file or directory pointed me in the right direction.