Connecting to MSSQL from django 1.8 on Ubuntu
Asked Answered
C

0

0

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 module named pythoncom.

According to this page I see that django-mssql needs PyWin32.

So I returned back to my snapshot in virtual machine and tried it with pip install django-mssql-backend and changed the ENGINE in settings.py to sql_server.pyodbc Now I have error message sql_server.pyodbc isn't an available database backend.

So I returned back to my snapshot in virtual machine and tried it with pip install mssql-django and ENGINE is mssql. This upgraded Django to 3.4.1.

So I returned to my snapshot of virtual machine. How can I connect to MSSQL from Django 1.8 without upgrading Django? Or is it impossible? Why?

Django 1.8 is running on Ubuntu 18.04

Clavichord answered 13/5, 2022 at 6:15 Comment(6)
What version of python have you installed? Try pip3 install django-mssqlMalignant
In my virtual environment I use Python 3.6.9.Clavichord
Try using: github.com/lionheart/django-pyodbc (Will only work with Python 2) Note: Django 1.8 is an insecure, unsupported version. Please consider upgrading to a newer version.Scrawly
@LordPokerFace It ends with ModuleNotFoundError: No module named pythoncomClavichord
@AbdulAzizBarkat This helped. Thanks a lot. You can write it as an answer. And ENGINE must be django_pyodbcClavichord
Use pip3 for install the needed modules.Malignant

© 2022 - 2024 — McMap. All rights reserved.