Using Sql Server with Django in production

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

  • what is difference between set based queries and row by row based queries in t-sql?
  • MySQL equivalent to MS SQL's Cross Apply
  • Permissions for truncating a table
  • Naming a column as a parameter passed in to a stored procedure
  • Escape special characters in SQL INSERT INTO via C#
  • select same child node from openxml sql stored procedure
  • 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?

  • Is there an sql admin panel made with Django? - Django
  • Configure Django with MS SQL Server database
  • A good way to encrypt database fields?
  • django-mssql: 'Query timeout expired' during syncdb
  • Django Model Choices: IntegerField vs CharField
  • Prevent Django from updating identity column in MSSQL
  • 4 Solutions collect form web for “Using Sql Server with Django in production”

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

    We are using django-mssql in production at our company. We too had an existing system using mssql. For me personally it was the best design decision I have ever made because my productivity increased dramatically now that I can use django .

    I submitted a patch but when I started using django-mssql and did a week or two of testing.Since then (October 2008) we run our system on django and it runs solid. I also tried pyodbc but I did not like to much.

    We are running a repair system where all transactions run through this system 40 heavy users. If you have more questions let me know.

    I have seen so many people get the following error after installing django_mssql on Windows:

    django.core.exceptions.ImproperlyConfigured: 'sqlserver_ado' isn't an available database backend.
    Try using django.db.backends.XXX, where XXX is one of:
      'dummy', 'mysql', 'oracle', 'postgresql_psycopg2', 'sqlite3'
    Error was: No module named sqlserver_ado.base

    The solution is installing the following plugin:

    Haven’t used it in production yet, but my initial experiences with django-mssql have been pretty solid. All you need are the Python Win32 extensions and to get the sqlserver_ado module onto your Python path. From there, you just use sql_server.pyodbc as your DATABASE_ENGINE. So far I haven’t noticed anything missing, but I haven’t fully banged on it yet either.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.