django-environ icon indicating copy to clipboard operation
django-environ copied to clipboard

Support for mssql-django

Open valentinschabschneider opened this issue 3 years ago • 3 comments

There is an official django-mssql-backend port by Microsoft in the making. To use it you have to provide "mssql" as the engine. https://github.com/microsoft/mssql-django#installation

Currently django-environ maps "mssql" to "sql_server.pyodbc". https://github.com/joke2k/django-environ/pull/157

Don't know what the solution is, but it would be nice if there's a way to configure mssql-django in the next release.

valentinschabschneider avatar May 21 '21 11:05 valentinschabschneider

Either remove the mapping from Env.DB_SCHEMES or add another one like "mssql2".

Workaround:

env.DB_SCHEMES.pop("mssql")

valentinschabschneider avatar May 21 '21 11:05 valentinschabschneider

I can confirm that this is still an issue. But the workaround works great.

MartinSchmidt123 avatar Jan 26 '22 13:01 MartinSchmidt123

Yes, still an issue. dj-database-url maps mssql to mssqlms: https://pypi.org/project/dj-database-url/

This workaround works, but would be nice to have a documented way to connect using mssql engine. Even documenting this workaround would be good.

hairypalm avatar Apr 06 '23 23:04 hairypalm