Giter Club home page Giter Club logo

django-pymssql's Introduction

django-pymssql

I'm not maintaining this library because I no longer use SQL Server. If you'd like to maintain it, please file an issue and let me know.

Goals

django-pymssql is a Django database backend for Microsoft SQL Server that works on non-Windows systems.

It's a small wrapper around django-mssql that uses pymssql instead of ADO to connect to SQL Server.

It should support the same versions of Python, Django and SQL Server as django-mssql.

The original use case was to connect to SQL Server from a Django project written in Python 3 and running on Linux.

Status

django-pymssql 1.7 almost passes Django's test suite with:

  • Python 2.7 or 3.4
  • Django 1.7.x + django-mssql 1.6.1 + pymssql 2.1.1
  • Microsoft® SQL Server® 2012 Express

Usage

django-pymssql provides a Django database engine called sqlserver_pymssql:

DATABASES = {
    'default': {
        'ENGINE': 'sqlserver_pymssql',
        'HOST': '...',
        'NAME': '...',
        'USER': '...',
        'PASSWORD': '...','
        'OPTIONS': {
            # ...
        },
    },
}

Any parameter accepted by pymssql.connect can be passed in OPTIONS.

Alternatives

django-sqlserver is a fork of django-mssql that supports python-tds and pymssql in addition to ADO on Windows. Unfortunately it has diverged and it lags behind django-mssql when it comes to supporting newer Django versions.

django-pyodbc relies on pyodbc to connect to SQL Server. It requires a complex stack that doesn't bring actual benefits. Besides it doesn't appear to be very mature nor actively maintained.

Hacking

Clone Django, pymssql, django-mssql and django-pymssql and pip install -e . each of them in a virtualenv.

Create a Django tests settings file with the database engine set to 'sqlserver_pymssql' and credentials for a testing SQL Server instance.

Go to the tests subdirectory in a clone of Django and execute ./runtests.py --settings=test_pymssql.

License

django-pymssql is released under the MIT license, like django-mssql. See the LICENSE file for details. Note that pymssql is released under the LGPL.

Some database version checking code was borrowed from django-sqlserver which is also released under the MIT license.

django-pymssql's People

Contributors

aaugustin avatar greggg230 avatar lpmi-13 avatar manfre avatar msabramo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.