title: How to connect to MsSQL server with Django
body: <p>I am struggling with connecting to my local MsSQL server with Django. It says when I make command 'makemigrations':</p>
  
  <blockquote>
    <p>django.core.exceptions.ImproperlyConfigured: 'sqlserver_ado' isn't an available database backend.
    Try using 'django.db.backends.XXX', where XXX is one of:
        'mysql', 'oracle', 'postgresql', 'sqlite3'</p>
  </blockquote>
  
  <p>My settings:</p>
  
  <pre><code>DATABASES = {
  'default': {
      'NAME': 'TestDB',
      'ENGINE': 'sqlserver_ado',
      'HOST': 'STEPAN',
      'USER': '',
      'PASSWORD': '',
  }
  </code></pre>
  
  <p>}</p>
  
  <p>In this solution: <a href="https://stackoverflow.com/questions/9944204/setting-up-django-mssql-issues">Setting up django-mssql issues</a> I found that my 'sqlserver_ado' should be in the same folder 'site-packages', which it is (Python IDLE shell):</p>
  
  <pre><code>&gt;&gt;&gt; import sqlserver_ado
  &gt;&gt;&gt; sqlserver_ado
  &lt;module 'sqlserver_ado' from 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python36_64\\lib\\site-packages\\sqlserver_ado\\__init__.py'&gt;
  &gt;&gt;&gt; import django
  &gt;&gt;&gt; django
  &lt;module 'django' from 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python36_64\\lib\\site-packages\\django\\__init__.py'&gt;
  </code></pre>
  
  <p>I have a PyWin32 installed and importing in IDLE is fine (even the path is fine), yet still I get this error message.</p>
  
  <p>Any ideas or advices?</p>
  
  <p>Spec: Win10, Python 3.6, Visual Studio 2017, django-mssql 1.8, django 2.0.6, MsSQL (developer) and this DB is present (with flask I have no problem to connect to my local server [just for comparsion my connection string in another flask project:</p>
  
  <pre><code>SQLALCHEMY_DATABASE_URI = "mssql+pyodbc:///?odbc_connect={}".format(urllib.parse.quote_plus(
      "DRIVER={SQL Server};Server=STEPAN;Database=TestDB;Trusted_Connection=yes;"))
  </code></pre>
  
  <p>]), project was automaticly created by Visual Studio, command that throws this error:</p>
  
  <pre><code>python manage.py makemigrations
  </code></pre>