Using Sql Server with Django in production

Josh Smeaton picture Josh Smeaton · May 9, 2009 · Viewed 43.1k times · Source

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?

Answer

Jason Baker picture Jason Baker · May 9, 2009

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).