Questions tagged [django-mssql-backend]

This tag is for the django-mssql-backend package, the best supported SQL Server Django database backend as of this writing in 2020.

The django-mssql-backend package supports using SQL Server as your database for a Django website. It supports modern versions of Django: 2.2 and above.

Visit the django-mssql-backend website for installation instructions and more details.

19 questions
5
votes
1 answer

Django MSSQL: Override Foreign Key Constraint Name Generation

I am attempting to create a database model in Django 3.0 using django-mssql-backend as by db backend for SQL Server 2019. The database uses multiple schemas for the tables included in it with some of the tables being non-managed (already exist), and…
4
votes
4 answers

Keyerror 'include' on migrating models to sql server

I have a django application and have backend as Microsoft sql server. For that, i have installed "pip install django-mssql-backend". I have extended User model and added one additional field of confirm_password and same i am migrating, but i am…
Ronak
  • 187
  • 2
  • 17
4
votes
1 answer

django-mssql-backend - Invalid connection string attribute (0)

OK, I'm slowly going crazy. I want to connect Django 3 to MSSQLv15 Server. Connection works if I use Trustedconnection=yes (using win credentials), it also works on Ubuntu if I'm using FreeTDS v7.4 but it won't work in Windows if I manually insert…
3
votes
0 answers

Schema in django models besides dbo in SQL Server

As I used the SQL Server, Django automatically creates and uses schema dbo for any tables. Is there any way to use existing schema, or force Django to use create another schema instead of all under dbo schema. For example: from django.db import…
Long Vu
  • 31
  • 1
2
votes
1 answer

How to fix pyodbc dependency errors when upgrade Django from 2.1 to 2.2.13?

Since version 2.1 has been marked as insecure I need to upgrade at least to >=2.2. Github security suggests installing 2.2.13. I also need to install other packages that only work with Django >=2.2. The Django upgrade is successful but when pipenv…
2
votes
2 answers

Connecting Django to Microsoft SQL Database

I want to connect my django application to MS-SQL server 2014 database. I wrote this code for making connections. DATABASES = { 'default': { 'ENGINE': 'sql_server.pyodbc', 'HOST':'DESKTOP-6UNRAN0', 'PORT':'1433', 'NAME': 'MOVIE', …
1
vote
1 answer

Django connect SQL Server using active directory user

I'm using Django and mssql-django backend to connect to SQL Server. No problems to connect to SQL Server when using sql login. But, when I try to connect using AD user, I get exception: django.db.utils.InterfaceError: ('28000', "[28000]…
Juozas
  • 916
  • 10
  • 17
1
vote
2 answers

Error while trying to connect Django to SQL Server using django-mssql-backend

Windows 10 SQL Server 2019 Python 3.9.1 Django 3.2.5 pip freeze: asgiref==3.4.1 Django==3.2.5 django-mssql-backend==2.8.1 djangorestframework==3.12.4 pyodbc==4.0.30 pytz==2021.1 sqlparse==0.4.1 DATABASES =…
Clay
  • 213
  • 1
  • 2
  • 9
1
vote
1 answer

Collation Error When creating Django Database Models

I have followed the various tutorials from philly and others to setup django with django-mssql-backend but have had no luck. I think the connection is working but when it is trying to parse the tables I get a collation error that it cannot get…
Griffen
  • 31
  • 8
1
vote
1 answer

Object.Filter() error using boolean fields

When I try to use model.objects.filter(mybooleanfield=True) gives me this error ('42000', "[42000] [Microsoft] [SQL Server Native Client 11.0] [SQL Server] A non-Boolean expression was specified in a context where a condition was expected, near…
M. Gar
  • 889
  • 4
  • 16
  • 33
1
vote
1 answer

Why isn't Django connecting to SQL Server 2019?

Please see below screenshots as to existing configuration (password hidden due to security reasons). Databases Screenshot 1 Python Packages The error that is returned when I attempt to run the server is either SQL Server v15 is not supported or…
1
vote
1 answer

Django 2.2 with external connection SQL SERVER

In my python 3.7 + Django 2.2 I need to connect to external SQL Server. Its not the main DB of Django (that remains in Postgres). I only need to make some query on a view. Im on Debian 9 and Im trying to install package to add sql server connection…
EviSvil
  • 510
  • 3
  • 21
0
votes
0 answers

Connecting to MSSQL from django 1.8 on Ubuntu

I need to connect to MSSQL database from Django 1.8 and preserve Django 1.8 (not upgrade to newer version od Django). I installed pip install django-mssql . ENGINE in settings.py is sqlserver_ado. It ended with error message ModuleNotFoundError: No…
xralf
  • 3,312
  • 45
  • 129
  • 200
0
votes
1 answer

Django should connect to SQL Server

I am using PyCharm, Django and the MSSQL-Backend-Project. I am working on my iMac, and in the local network there is a Microsoft SQL Server I would like to connect to. I am not sure what credentials to use (IP, oder the HOST named below). However…
0
votes
1 answer

Django - Multiple File upload data not inserted in model database

I have implemented a feature to upload multiple files for each RetailerMaster(as foreign key). Once I migrate this model to microsoft sql server, FileUpload model is created without primary key which django should be creating automatically. Also if…
1
2