title: How to connect to Azure SQL database from Django app on Linux VM
body: <p>I searched tutorials or full explanations about using SQL Azure Database with Django application, that hosted on Linux VM.</p>
  
  <p>I changed database section of settings.py like this</p>
  
  <pre><code>DATABASES = {
      'default': {
          'ENGINE': 'sql_server.pyodbc',
          'NAME': 'azure_database_name',
          'USER': 'user@server_name_like_wjrnvlwjrng3',
          'PASSWORD': 'my_pass',
          'HOST': 'server_name_like_wjrnvlwjrng3.database.windows.net',
          'PORT': '1433',
          'OPTIONS': {
              'driver': 'FreeTDS',
              'TDS_Version': '7.1',
          }
      }
  }
  </code></pre>
  
  <p>I append </p>
  
  <pre><code>[MyDb]
      host = server_name_like_wjrnvlwjrng3.database.windows.net
      port = 1433
      tds version = 7.1
  </code></pre>
  
  <p>to /etc/freetds/freetds.conf</p>
  
  <p>And changed /etc/odbc.ini</p>
  
  <pre><code>[MyDb]
  Description     = ololo lalala text
  Driver          = FreeTDS
  Servername      = server_name_like_wjrnvlwjrng3
  Database        = azure_database_name
  UID             = user@server_name_like_wjrnvlwjrng3
  PWD             = my_pass
  Port            = 1433
  Charset         = UTF-8
  </code></pre>
  
  <p>And after that I tried to call <code>python manage.py migrate</code> and got an error</p>
  
  <pre><code>django.db.utils.Error: ('001', '[001] [nxDC[reD]SLSre]nbet onc odt ore (0) (SQLDriverConnect)')
  </code></pre>
  
  <p>Please, help me with it.</p>