[Django]-Query timeout expired in django-mssql when executing custom SQL directly

6👍

You can adjust the COMMAND_TIMEOUT in the database config, in your django settings file. Example of using COMMAND_TIMEOUT:

DATABASES = {
'default': {
    'NAME': DATABASE_NAME,
    'ENGINE': 'sqlserver_ado',
    'HOST': DATABASE_HOST,
    'USER': DATABASE_USER,
    'PASSWORD': DATABASE_PASSWORD,
    'COMMAND_TIMEOUT': DATABASE_COMMAND_TIMEOUT,
   }
}

Leave a comment