0

I need help with connecting to the Sybase SQL Anywhere database via the pyodbc library. When I am running a local development server or local python desktop script connection is established easily and successfully. I found out that the problem is in the SQL Anywhere 17 driver. In the scripts below you can see that when I run pyodbc.drivers() in a local environment I get a list with a few drivers, and when I repeat the same in the App platform application console I get an empty list.

My question is how can I install or transfer SQL Anywhere 17 driver to the App platform or ubuntu droplet? Thank you!

pyodbc drivers in local environment

pyodbc drivers on app platform

views.py code

connection_string = "Driver=SQL Anywhere 17;" \
                    "Server=xxx;" \
                    "Host=host;" \
                    "UID=user;" \
                    "PWD=pass;" \
                    "DBN=db_test;" \
                    "Port=xxxx;" \
                    "DSN=xxxx;" \
                    "dobroadcast=all;" \
                    "APPINFO=xxx;"

def my_view(request):
    rows = []
    with pyodbc.connect(connection_string) as conn:
        cur = conn.cursor()
        cur.execute('SELECT NAZIV1 FROM ARTIKEL')
        rows = list(cur.fetchall())
    return render(request, 'app/my_template.html', {'rows': rows})

0 Answers0