Skip to main content

Tarantool database backend for Django

Project description

Django Tarantool database backend

Build Status Build Status

PyPI - Django Version

Installation

Install Tarantool v2.2+. See the installation manual for your OS here

Make a database directory and run Tarantool instance there:

$ mkdir ~/project_db
$ cd ~/project_db
$ tarantool

You will see the Tarantool interpreter. Initialize DB configuration and create password for admin

tarantool> box.cfg({ listen = 3301 })
tarantool> box.schema.user.passwd('admin', 'password')

To get started with django-tarantool, run the following in a virtual environment:

pip install django-tarantool

Add DATABASES config of your Tarantool into settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django_tarantool.backend',
        'HOST': '127.0.0.1',
        'PORT': '3301',
        'USER': 'admin',
        'PASSWORD': 'password',
        'CONN_MAX_AGE': 3600,
    }
}

Mind using CONN_MAX_AGE param as very important. It allows to keep connection opened for the specified time in seconds. Otherwise, Django will open the connection to the Tarantool instance on each request and close after it, which increases the request latency.

Run migrate as usual:

python manage.py migrate

Run Django development server:

python manage.py runserver 0:8000

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-tarantool-0.0.20.tar.gz (21.4 kB view details)

Uploaded Source

File details

Details for the file django-tarantool-0.0.20.tar.gz.

File metadata

  • Download URL: django-tarantool-0.0.20.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.7

File hashes

Hashes for django-tarantool-0.0.20.tar.gz
Algorithm Hash digest
SHA256 b8f53a24a97f1f771ad2fdbbc57748b34f016e39858476ef94a80372fb01d7ac
MD5 ac8a7b424efbb54cd26e98c3f005d557
BLAKE2b-256 82edb20761553293ee5bd18ee56048e3dfb6ac1f34716f7048ff9daa2bef05dd

See more details on using hashes here.

Supported by

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