{"id":15024429,"url":"https://github.com/michiya/django-pyodbc-azure","last_synced_at":"2025-10-06T08:31:31.476Z","repository":{"id":4670009,"uuid":"5816230","full_name":"michiya/django-pyodbc-azure","owner":"michiya","description":"Django backend for Microsoft SQL Server and Azure SQL Database using pyodbc","archived":false,"fork":true,"pushed_at":"2023-08-07T16:12:28.000Z","size":769,"stargazers_count":323,"open_issues_count":111,"forks_count":141,"subscribers_count":32,"default_branch":"azure-2.1","last_synced_at":"2024-03-15T07:04:40.701Z","etag":null,"topics":["azure-sql-database","django","mssql","odbc","pyodbc","python"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/django-pyodbc-azure","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"avidal/django-pyodbc","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michiya.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2012-09-15T00:22:41.000Z","updated_at":"2023-10-30T09:51:44.000Z","dependencies_parsed_at":"2023-07-05T19:16:29.902Z","dependency_job_id":null,"html_url":"https://github.com/michiya/django-pyodbc-azure","commit_stats":{"total_commits":386,"total_committers":19,"mean_commits":20.31578947368421,"dds":0.4119170984455959,"last_synced_commit":"a902a956e2a492ec349d4637a618183c14216ec7"},"previous_names":[],"tags_count":77,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michiya%2Fdjango-pyodbc-azure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michiya%2Fdjango-pyodbc-azure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michiya%2Fdjango-pyodbc-azure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michiya%2Fdjango-pyodbc-azure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michiya","download_url":"https://codeload.github.com/michiya/django-pyodbc-azure/tar.gz/refs/heads/azure-2.1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235515424,"owners_count":19002481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure-sql-database","django","mssql","odbc","pyodbc","python"],"created_at":"2024-09-24T20:00:20.822Z","updated_at":"2025-10-06T08:31:26.183Z","avatar_url":"https://github.com/michiya.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"django-pyodbc-azure\n===================\n\n.. image:: http://img.shields.io/pypi/v/django-pyodbc-azure.svg?style=flat\n    :target: https://pypi.python.org/pypi/django-pyodbc-azure\n\n.. image:: http://img.shields.io/pypi/l/django-pyodbc-azure.svg?style=flat\n    :target: http://opensource.org/licenses/BSD-3-Clause\n\n*django-pyodbc-azure* is a modern fork of\n`django-pyodbc \u003chttps://code.google.com/archive/p/django-pyodbc/\u003e`__, a\n`Django \u003chttps://www.djangoproject.com/\u003e`__ Microsoft SQL Server external\nDB backend that uses ODBC by employing the\n`pyodbc \u003chttps://github.com/mkleehammer/pyodbc\u003e`__ library. It supports\nMicrosoft SQL Server and Azure SQL Database.\n\nFeatures\n--------\n\n-  Supports Django 2.1\n-  Supports Microsoft SQL Server 2008/2008R2, 2012, 2014, 2016, 2017 and\n   Azure SQL Database\n-  Passes most of the tests of the Django test suite\n-  Compatible with\n   `Micosoft ODBC Driver for SQL Server \u003chttps://docs.microsoft.com/en-us/sql/connect/odbc/microsoft-odbc-driver-for-sql-server\u003e`__,\n   `SQL Server Native Client \u003chttps://msdn.microsoft.com/en-us/library/ms131321(v=sql.120).aspx\u003e`__,\n   and `FreeTDS \u003chttp://www.freetds.org/\u003e`__ ODBC drivers\n\nDependencies\n------------\n\n-  Django 2.1\n-  pyodbc 3.0 or newer\n\nInstallation\n------------\n\n1. Install pyodbc and Django\n\n2. Install django-pyodbc-azure ::\n\n    pip install django-pyodbc-azure\n\n3. Now you can point the ``ENGINE`` setting in the settings file used by\n   your Django application or project to the ``'sql_server.pyodbc'``\n   module path ::\n\n    'ENGINE': 'sql_server.pyodbc'\n\nConfiguration\n-------------\n\nStandard Django settings\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe following entries in a database-level settings dictionary\nin DATABASES control the behavior of the backend:\n\n-  ENGINE\n\n   String. It must be ``\"sql_server.pyodbc\"``.\n\n-  NAME\n\n   String. Database name. Required.\n\n-  HOST\n\n   String. SQL Server instance in ``\"server\\instance\"`` (on-premise) or\n   ``\"server.database.windows.net\"`` (Azure SQL Database) format.\n\n-  PORT\n\n   String. Server instance port.\n   An empty string means the default port.\n\n-  USER\n\n   String. Database user name in ``\"user\"`` (on-premise) or\n   ``\"user@server\"`` (Azure SQL Database) format.\n   If not given then MS Integrated Security will be used.\n\n-  PASSWORD\n\n   String. Database user password.\n\n-  AUTOCOMMIT\n\n   Boolean. Set this to False if you want to disable\n   Django's transaction management and implement your own.\n\nand the following entries are also available in the TEST dictionary\nfor any given database-level settings dictionary:\n\n-  NAME\n\n   String. The name of database to use when running the test suite.\n   If the default value (``None``) is used, the test database will use\n   the name \"test\\_\" + ``NAME``.\n\n-  COLLATION\n\n   String. The collation order to use when creating the test database.\n   If the default value (``None``) is used, the test database is assigned\n   the default collation of the instance of SQL Server.\n\n-  DEPENDENCIES\n\n   String. The creation-order dependencies of the database.\n   See the official Django documentation for more details.\n\n-  MIRROR\n\n   String. The alias of the database that this database should\n   mirror during testing. Default value is ``None``.\n   See the official Django documentation for more details.\n\nOPTIONS\n~~~~~~~\n\nDictionary. Current available keys are:\n\n-  driver\n\n   String. ODBC Driver to use (``\"ODBC Driver 13 for SQL Server\"``,\n   ``\"SQL Server Native Client 11.0\"``, ``\"FreeTDS\"`` etc).\n   Default is ``\"ODBC Driver 13 for SQL Server\"``.\n\n-  isolation_level\n\n   String. Sets `transaction isolation level\n   \u003chttps://docs.microsoft.com/en-us/sql/t-sql/statements/set-transaction-isolation-level-transact-sql\u003e`__\n   for each database session. Valid values for this entry are\n   ``READ UNCOMMITTED``, ``READ COMMITTED``, ``REPEATABLE READ``,\n   ``SNAPSHOT``, and ``SERIALIZABLE``. Default is ``None`` which means\n   no isolation levei is set to a database session and SQL Server default\n   will be used.\n\n-  dsn\n\n   String. A named DSN can be used instead of ``HOST``.\n\n-  host_is_server\n\n   Boolean. Only relevant if using the FreeTDS ODBC driver under\n   Unix/Linux.\n\n   By default, when using the FreeTDS ODBC driver the value specified in\n   the ``HOST`` setting is used in a ``SERVERNAME`` ODBC connection\n   string component instead of being used in a ``SERVER`` component;\n   this means that this value should be the name of a *dataserver*\n   definition present in the ``freetds.conf`` FreeTDS configuration file\n   instead of a hostname or an IP address.\n\n   But if this option is present and it's value is ``True``, this\n   special behavior is turned off.\n\n   See http://www.freetds.org/userguide/dsnless.htm for more information.\n\n-  unicode_results\n\n   Boolean. If it is set to ``True``, pyodbc's *unicode_results* feature\n   is activated and strings returned from pyodbc are always Unicode.\n   Default value is ``False``.\n\n-  extra_params\n\n   String. Additional parameters for the ODBC connection. The format is\n   ``\"param=value;param=value\"``.\n\n-  collation\n\n   String. Name of the collation to use when performing text field\n   lookups against the database. Default is ``None``; this means no\n   collation specifier is added to your lookup SQL (the default\n   collation of your database will be used). For Chinese language you\n   can set it to ``\"Chinese_PRC_CI_AS\"``.\n\n-  connection_timeout\n\n   Integer. Sets the timeout in seconds for the database connection process.\n   Default value is ``0`` which disables the timeout.\n\n-  connection_retries\n\n   Integer. Sets the times to retry the database connection process.\n   Default value is ``5``.\n\n-  connection_retry_backoff_time\n\n   Integer. Sets the back off time in seconds for reries of\n   the database connection process. Default value is ``5``.\n\n-  query_timeout\n\n   Integer. Sets the timeout in seconds for the database query.\n   Default value is ``0`` which disables the timeout.\n\nbackend-specific settings\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe following project-level settings also control the behavior of the backend:\n\n-  DATABASE_CONNECTION_POOLING\n\n   Boolean. If it is set to ``False``, pyodbc's connection pooling feature\n   won't be activated.\n\nExample\n~~~~~~~\n\nHere is an example of the database settings:\n\n::\n\n    DATABASES = {\n        'default': {\n            'ENGINE': 'sql_server.pyodbc',\n            'NAME': 'mydb',\n            'USER': 'user@myserver',             \n            'PASSWORD': 'password',\n            'HOST': 'myserver.database.windows.net',\n            'PORT': '',\n\n            'OPTIONS': {\n                'driver': 'ODBC Driver 13 for SQL Server',\n            },\n        },\n    }\n    \n    # set this to False if you want to turn off pyodbc's connection pooling\n    DATABASE_CONNECTION_POOLING = False\n\nLimitations\n-----------\n\nThe following features are currently not supported:\n\n- Altering a model field from or to AutoField at migration\n\nNotice\n------\n\nThis version of *django-pyodbc-azure* only supports Django 2.1.\nIf you want to use it on older versions of Django,\nspecify an appropriate version number (2.0.x.x for Django 2.0)\nat installation like this: ::\n\n    pip install \"django-pyodbc-azure\u003c2.1\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichiya%2Fdjango-pyodbc-azure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichiya%2Fdjango-pyodbc-azure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichiya%2Fdjango-pyodbc-azure/lists"}