Django Scylla
Project description
Django Scylla - the Cassandra & ScyllaDB backend for Django
Django-scylla makes possible to connect your Django app to Cassandra or ScyllaDB and use native Django ORM as with any other relational database backend.
Discord: https://discord.gg/pxunMGmDNc
Sponsors
Help support ongoing development and maintenance by sponsoring Django Scylla.
Installation
Recommended installation:
pip install django-scylla
Basic Usage
-
Add
django_scylla
toINSTALLED_APPS
in yoursettings.py
file:INSTALLED_APPS = ('django_scylla',) + INSTALLED_APPS
-
Change
DATABASES
setting:DATABASES = { 'default': { 'ENGINE': 'django_scylla', 'NAME': 'db', 'TEST_NAME': 'test_db', 'HOST': 'db1.example.com,db2.example.com,db3.example.com', 'OPTIONS': { 'consistency_level': ..., 'load_balancing_policy': ..., 'retry_policy': ..., 'request_timeout': 10, } } }
-
Define some model:
# myapp/models.py from django.db import models class Person(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30)
-
Connect to ScyllaDB and create a keyspace.
-
Run
./manage.py makemigrations && ./manage.py migrate
-
Done!
License
Copyright (c) 2021-2022, Rafał Furmański.
All rights reserved. Licensed under MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django_scylla-0.0.2.tar.gz
(15.2 kB
view hashes)
Built Distribution
Close
Hashes for django_scylla-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7a53f9d97f6b4e5a6325fbf3835d7f1e960085833ba32ccddacd4bb7b3b91ce |
|
MD5 | 7e26b2b51e7d4f65cbeecb589707be8a |
|
BLAKE2b-256 | caa10f6c1445fad0ebef8029e239d83df693f1194bfcc514586d4364711822e5 |