Error using syncdb Django app for Azure SQL using pyodbc

I am trying to run a Django app on Azure. I had an application working with some static pages, but I cannot get the database to work properly. I downloaded pyodbc so that Django can talk to an Azure SQL Database and put it on both my local machine and the web server. I also updated the Azure site to use Django-1.6 instead of the standard 1.4, but I am still using Python 2.7

I have already set up the Azure file template rules to allow access from my IP

In settings.py, I configured the DATABASES section as follows:

'ENGINE': 'sql_server.pyodbc',
'NAME': 'django-sql',         
'USER': '<username>@<server>',
'PASSWORD': '<password>',
'HOST': '<server>.database.windows.net',
'PORT': '1433',            
'OPTIONS': {
    'driver': 'SQL Server Native Client 11.0',
    'MARS_Connection': True,
},

      

When I try to run syncdb from my local computer, I get this error:

django.db.utils.Error: ('00000', '[00000] [iODBC][Driver Manager]dlopen({SQL Server Native Client 11.0}, 6): image not found (0) (SQLDriverConnect)')

      

I've tried reformulating settings.py a bit and still get the same error. I tried to put the PORT number after the HOST name as shown in the Azure Portal and I tried to use the fully qualified HOST name in USER.

0


source to share


1 answer


It looks like iODBC is not supported. However, unixODBC is supported. I was able to deploy an Azure Ubuntu VM and follow this tutorial to get syncdb up and running. Not perfect, but it will work for now.



0


source







All Articles