Skip to content
This repository has been archived by the owner on Jun 15, 2018. It is now read-only.

Latest commit

 

History

History
50 lines (40 loc) · 1.47 KB

README.md

File metadata and controls

50 lines (40 loc) · 1.47 KB

django-mysqlndb-backend

django-mysqlndb-backend is a project that provides a django database backend that works with MySQL Cluster. The MySQL backend provided by django does not currently work with MySQL Cluster because of a bug in the handling of foreign key constructs. The backend provided in this module extends and overrides the behavior of django's MySQL database backend to suppress foreign key constraints in ALTER TABLE and CREATE TABLE constructs. It also includes a South backend for django apps using South for migrations.

Installation

The recommended way to install from source is with pip:

$ pip install -e git+git://github.com/theatlantic/django-mysqlndb-backend.git#egg=django-mysqlndb-backend

If the source is already checked out, use setuptools:

$ python setup.py install

Usage

When defining your database in settings.py, set ENGINE to 'mysqlndb' rather than 'django.db.backends.mysql' / 'mysql'.

DATABASES = {
    'default': {
        'OPTIONS': {
            'init_command': 'SET storage_engine=ndbcluster',
        },
        'ENGINE': 'mysqlndb',
        'NAME': 'database_name',
        'USER': 'root',
        'PASSWORD': '',
        'HOST': 'localhost',
        'PORT': '',
    }
}

# If south is included in INSTALLED_APPS, this is required:
SOUTH_DATABASE_ADAPTERS = {
    'default': 'mysqlndb.south_backend',
}