Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ in DATABASES control the behavior of the backend:
Boolean. Set this to `False` if you want to disable
Django's transaction management and implement your own.

- Trusted_Connection

String. Default is `"yes"`. Can be set to `"no"` if required.

and the following entries are also available in the `TEST` dictionary
for any given database-level settings dictionary:

Expand Down
3 changes: 2 additions & 1 deletion mssql/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ def get_new_connection(self, conn_params):
user = conn_params.get('USER', None)
password = conn_params.get('PASSWORD', None)
port = conn_params.get('PORT', None)
trusted_connection = conn_params.get('Trusted_Connection', 'yes')

options = conn_params.get('OPTIONS', {})
driver = options.get('driver', 'ODBC Driver 13 for SQL Server')
Expand Down Expand Up @@ -289,7 +290,7 @@ def get_new_connection(self, conn_params):
cstr_parts['PWD'] = password
else:
if ms_drivers.match(driver):
cstr_parts['Trusted_Connection'] = 'yes'
cstr_parts['Trusted_Connection'] = trusted_connection
else:
cstr_parts['Integrated Security'] = 'SSPI'

Expand Down