3

I am writing a Django application which needs to intereact with a SQLServer Database. I use the Django MSSQL Backend ADO.

I am trying to use it in a Linux machine (CentOS 6.4), but for the moment I am not able to establish the connection.

Anyone has suceeded on it or knows if it is possible to connect to django-mssql from a Linux environment?

Note: I've found this question but it is quite old. I am looking for an up-to-date answer.

Edit: The error I am receiving is the following. Remark that it is a Linux machine.

django.core.exceptions.ImproperlyConfigured: 'sqlserver_ado' isn't an available database backend.

Edit 2: PyWin32 is a requirement for the django-mssql package. But is possible any workaround for Linux?

Community
  • 1
  • 1
Miquel
  • 858
  • 11
  • 20

2 Answers2

7

Django-MSSQL only works on Windows, hence the pywin32 dependency (Actually, anything ADO is Windows dependent since it's built on Microsoft's ActiveX).

Try Django-SQLServer. It's based on Django-MSSQL but can pass info using python-tds which is not platform specific.

justinsg
  • 738
  • 6
  • 11
dbJones
  • 762
  • 1
  • 10
  • 31
1

I will suggest to use django-pyodbc-azure instead of Django-MSSQL

  1. Supports Django 2.0.3
  2. Supports Microsoft SQL Server 2008/2008R2, 2012, 2014, 2016, 2017 and Azure SQL Database
  3. Compatible with Micosoft ODBC Driver for SQL Server, SQL Server Native Client, and FreeTDS ODBC drivers
Ajinkya Bhosale
  • 343
  • 3
  • 9