Giter VIP home page Giter VIP logo

django-sqlserver's Introduction

Django MSSQL Database Backend

https://ci.appveyor.com/api/projects/status/hj5o8fhpllcfypte/branch/master?svg=true

A minimal wrapper for django-mssql to make it work with python-tds.

In addition to django-mssql features this package also supports:

  • select_for_update
  • multiple NULLs in unique constraints

Supported MSSQL versions:

  • 2012
  • 2014
  • 2016

Requirements

  • django-mssql, version 1.6.x
  • Python 2.7 or 3.6

Installation

pip install git+https://bitbucket.org/Manfre/django-mssql.git#egg=django-mssql
pip install git+https://github.com/denisenkom/django-sqlserver.git#egg=django-sqlserver

Configuration

You would need to add database configuration, here is example:

DATABASES = {
    'default': {
        'ENGINE': 'sqlserver',
        'HOST': 'mysqlserverhost\\instance',  # Replace with host name where you have MSSQL server running
        'NAME': 'mydbname',  # Replace with name of the database on the MSSQL server
        'USER': 'username',  # Replace with user name
        'PASSWORD': '*****',  # Replace with password
    },

You can also specify additional OPTIONS attribute as described in http://django-mssql.readthedocs.io/en/latest/settings.html#options

Status

Works on python-tds, ADO not tested yet, but should work too. Django 1.7 migration tests are not fully passing yet.

License

MIT

Known Issues

  • Doesn't work with old DATETIME columns. To use this package you should change all DATETIME columns to DATETIME2(6).

Testing

This project integrates with Django's own test suite.

You need to install Python 2.7 or newer.

You need to install virtualenv.

To run tests you need to install Microsoft SQL Server 2012 or newer.

In SQL server create user sa with password sa, alternatively you can use different user but in this case you should set SQLUSER and SQLPASSWORD environment variables.

You should enable TCP/IP connections for SQL server.

If you use SQL server instance name provide it in SQLINSTANCE environment variable.

If your SQL server runs on host different from localhost you need to provide name of the host in HOST environment variable.

To run test run:

python acceptance_test.py

django-sqlserver's People

Contributors

denisenkom avatar quapka avatar jesselang avatar keithcallenberg avatar petrprikryl 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.