Skip to main content

Django backend for Microsoft SQL Server with load balancer support

Project description

Database engine based on django-pyodbc-azure that overrides database connection. If OPTIONS dictionary contains load_balancer it must be an object with choose method which returnds list of hosts.

Example configuration:

DATABASES = {
    'default': {
        'ENGINE': 'sql_server_lb',
        'NAME': 'database',
        'USER': 'user',
        'PASSWORD': 'password'
        'HOST': 'host',  # Not used
        'PORT': 1433,
        'COMMAND_TIMEOUT': 360,
        'CONN_MAX_AGE': 3600,  # Persistent connection limited to an hour
        'OPTIONS': {
            'load_balancer': LoadBalancer('database'),
            'driver': 'FreeTDS',
            'host_is_server': True,
            'extra_params': 'TDS_Version=7.3',
        }
    },
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-pyodbc-lb-1.11.0.0.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

django_pyodbc_lb-1.11.0.0-py2-none-any.whl (5.2 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page