Page Actions
Wiki Actions
User Actions
Submit This Story

Django with SQL Server 2000

Had luck on building a Django enviroment on Windows 2003 and use MS SQL Server 2000 as DB.
After some googling, got things working with pyodbc and django-pyodbc. Here is a snippet of the settings.py:

    DATABASE_ENGINE = 'sql_server.pyodbc'
    DATABASE_NAME = 'dbname'
    DATABASE_USER = 'sa'
    DATABASE_PASSWORD = 'password'
    DATABASE_HOST = ''             # Set to empty string for localhost.
    DATABASE_PORT = ''             # Set to empty string for default.
    DATABASE_OPTIONS= {
        'driver': 'SQL Server',
        'MARS_Connection': True,
        'dsn': 'your_dsn_on_ODBC_Settings',
    }

Just set up ODBC and it's working. I personally prefer pyodbc as production DB driver for it's mature and just works.
ALL utf-8 python code work with ANSI DB, handles Chinese with no problem.

Discussion

Enter your comment
 
 
blog/2009/10/django_with_sql_server_2000.txt · Last modified: 2009/10/01 00:00 (external edit)     Back to top
Recent changes RSS feed Creative Commons License Powered by PHP Driven by DokuWiki