0

So after finishing my Django Project everything works fine on the test database server with following settings:

DATABASES = {
    'default': {
        'ENGINE':'sql_server.pyodbc',
        'NAME':'xxx',
        'USER':'xxx',
        'PASSWORD':'xxx',
        'HOST':'192.168.10.40',
        'OPTIONS': {
           'driver': 'ODBC Driver 13 for SQL Server',
       },

   },
   '200000': {
        'ENGINE':'sql_server.pyodbc',
        'NAME':'xxx',
        'USER':'xxx',
        'PASSWORD':'xxx',
        'HOST':'192.168.10.40',
        'OPTIONS': {
           'driver': 'ODBC Driver 13 for SQL Server',
       },
    },
}

but after trying to change it to the new database server like:

DATABASES = {
    'default': {
        'ENGINE':'sql_server.pyodbc',
        'NAME':'xxx',
        'USER':'xxx',
        'PASSWORD':'xxx',
        'HOST':'192.168.10.36/ATS',
        'OPTIONS': {
           'driver': 'ODBC Driver 13 for SQL Server',
       },

   },
   '200000': {
        'ENGINE':'sql_server.pyodbc',
        'NAME':'xxx',
        'USER':'xxx',
        'PASSWORD':'xxx',
        'HOST':'192.168.10.36\ATS',
        'OPTIONS': {
           'driver': 'ODBC Driver 13 for SQL Server',
       },
    },
}

i get a server error 500 after like 2minutes when i change the database server back to the old one it works again what problems can cause this error? can it be that i got an instance on the server and the /ATS is causing the problem?

After some research and setting debug to true in django i get the following error msg:

OperationalError at / ('HYT00', '[HYT00] [unixODBC][Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired (0) (SQLDriverConnect)')

In the Apache error log there is following error:

[Tue Feb 12 08:02:24.905988 2019] [ssl:warn] [pid 12571:tid 139890139985088] AH01916: Init: (127.0.1.1:443) You configured HTTP(80) on the standard HTTPS(443) port! [Tue Feb 12 08:02:24.918022 2019] [ssl:warn] [pid 12572:tid 139890139985088] AH01916: Init: (127.0.1.1:443) You configured HTTP(80) on the standard HTTPS(443) port!

When i run the django app on visual studio it works fine with the new sql server settings. only after deploying it to apache with the new sql server settings i cant establish a connection.

  • you need to set `debug = True` in settings.py to see what exact error happened. Once you post that error then only we can tell you how to fix that – Vaibhav Vishal Feb 12 '19 at 07:01
  • okay after doing that i get the following error msg: ´OperationalError at / ('HYT00', '[HYT00] [unixODBC][Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired (0) (SQLDriverConnect)') ´ when i look into the error file in apache it says:´ [Tue Feb 12 08:02:24.905988 2019] [ssl:warn] [pid 12571:tid 139890139985088] AH01916: Init: (127.0.1.1:443) You configured HTTP(80) on the standard HTTPS(443) port! [Tue Feb 12 08:02:24.918022 2019] [ssl:warn] [pid 12572:tid 139890139985088] AH01916: Init: (127.0.1.1:443) You configured HTTP(80) on the standard HTTPS(443) port!´ – Le-Hao Nguyen Feb 12 '19 at 07:08
  • edit your question and put the error in there, also try googling the error. I am not an expert in sql server so I can't help much. – Vaibhav Vishal Feb 12 '19 at 07:09

0 Answers0