Using Sql Server with Django in production


Question

Has anybody got recent experience with deploying a Django application with an SQL Server database back end? Our workplace is heavily invested in SQL Server and will not support Django if there isn't a sufficiently developed back end for it.

I'm aware of mssql.django-pyodbc and django-mssql as unofficially supported back ends. Both projects seem to have only one person contributing which is a bit of a worry though the contributions seem to be somewhat regular.

Are there any other back ends for SQL Server that are well supported? Are the two I mentioned here 'good enough' for production? What are your experiences?

1
46
8/11/2009 10:15:46 AM

Accepted Answer

As has been stated, django-pyodbc is a good way to go. PyODBC is probably the most mature SQL Server library for Python there is.

The only thing you may have problems with is that pyodbc doesn't support stored procedures very well (you can call them, but you have no way to get results from them). You can call them using pymssql, but I would avoid it if at all possible as it doesn't support the standard DB-API interface and may be subject to changes. If you need to do this, your best bet is to use adodbapi directly (it's included with the python win32 package, which you'll probably end up installing anyway).

21
5/9/2009 3:47:54 PM

These days

  • django-mssql: resulted in error "NoneType not callable" upon ./manage.py migrate
  • avidal/django-pyodbc: unmaintained. Replaced by:
    • django-pyodbc: no support for python 3
    • django-pyodbc-azure: works for me so far
      • EDIT: Seems to be unmaintained. Filed issue 125 asking about status
      • EDIT: got reply from maintainer. Will be made up-to-date with Django 2.0 soon
      • EDIT: maintainer released version 2.0 for django 2.0
      • EDIT: maintainer released version 2.1 for django 2.1

EDIT: Here are the package versions

Django==1.11.6
django-mssql==1.8
pyodbc==4.0.19
django-pyodbc==1.1.1
django-pyodbc-azure==1.11.0.0

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon