Django Tarantool 0.0.20 | Coderz Repository

django-tarantool 0.0.20

Last updated:

0 purchases

django-tarantool 0.0.20 Image
django-tarantool 0.0.20 Images

Free

Languages

Categories

Add to Cart

Description:

djangotarantool 0.0.20

Django Tarantool database backend



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

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product: (if this is empty don't purchase this product)

Customer Reviews

There are no reviews.