Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- django.core.exceptions.ImproperlyConfigured: 'django-pyodbc-azure' isn't an available database backend.
- Try using 'django.db.backends.XXX', where XXX is one of:
- 'mysql', 'oracle', 'postgresql', 'sqlite3'
- C:Users\AppDataLocalProgramsPythonPython37-32Libsite-packages
- - django_pyodbc
- - django_pyodbc-2.0.0a1.dist-info
- - django_mssql-1.8.dist-info
- - django_pyodbc_azure-2.1.0.0.dist-info
- import pyodbc
- server = 'test-server-local'
- database = 'TEST-DB'
- username = 'sql_username'
- password = 'password'
- cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';DATABASE='+database+';UID='+username+';PWD='+ password)
- cursor = cnxn.cursor()
- cursor.execute("SELECT DepartmentName, DepartmentID from dbo.Departments;")
- row = cursor.fetchone()
- while row:
- print(row.DepartmentID, row.DepartmentName)
- row = cursor.fetchone()
Add Comment
Please, Sign In to add comment