Django and Remote Sybase Servers

It took me a while to figure it out, so I decided to share.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
    DATABASES = {
        'default': {
            'ENGINE': 'sqlany_django',
            'USER': 'YOUR-USER',
            'PASSWORD': 'YOUR-PASSWORD',
            'OPTIONS': {
                'links': 'tcpip(host=YOUR-DB-IP-OR-HOSTNAME;DoBroadcast=None)',
                'ServerName': 'YOUR-SERVER-NAME',
            },
        }
    }

For the sake of completeness, connecting via the regular DB API would be:

1
2
3
4
5
    sqlanydb.connect(
        links='tcpip(host=YOUR-SERVER-HOST;DoBroadcast=None)',
        ServerName='YOUR-DB-NAME',
        uid='YOUR-USER',
        pwd='YOUR-PASSWORD')

It’s not hard – but tedious to tinker out.

← See all posts