1

I'm new to Django and I'm working on a project that requires SQL Server to be used. I've researched extensively on using Django with SQL Server, and it seems like django-pyodbc is the way to go. On the pydobc page, it mentions that only SQL Server 2000 and 2005 is supported. However, on other questions asked, it seems like 2008 is somewhat supported.

Is it possible at all to use Django with SQL Server 2012 on a Linux environment?

Please point me to the right direction! Thanks!

1 Answers1

3

The top result on Google isn't the release you want to use; it hasn't been updated since 2011. Here's an active, updated repository which supports up to 2012 (and I will start testing 2014 soon):

https://github.com/lionheart/django-pyodbc/

Please let me know if you have any issues, and look through known issues; for example, when connecting, you'll need to include 'autocommit: true' in options:

'OPTIONS': {
    'host_is_server': True,
    'dsn': 'sql14-dev.example.com',
    'autocommit': True,
    'unicode_results': True,
    'extra_params': 'tds_version=7.2'
},
FlipperPA
  • 13,607
  • 4
  • 39
  • 71
  • I have recently changed this. It is best to specify the exact TDS Version: http://www.freetds.org/userguide/choosingtdsprotocol.htm Also, I've found that if you want to use "python manage.py runshell" or "python manage.py loaddata [json file]", you're going to have to set up FreeTDS and UnixODBC DSNs. I can also confirm this is properly working on SQL Server 2012 and 2014. – FlipperPA Jun 30 '14 at 19:30
  • Just a follow up: I have tested this against SQL Server 2014, and everything is working just as on SQL Server 2012. – FlipperPA Aug 21 '14 at 15:31