Django Cassandra Engine - the Cassandra backend for Django
Project description
Django Cassandra Engine - the Cassandra backend for Django
All tools you need to start your journey with Apache Cassandra and Django Framework!
Features
- integration with latest
python-driver
and optionallydse-driver
from DataStax - working
flush
,migrate
,sync_cassandra
,inspectdb
anddbshell
commands - support for creating/destroying test database
- accepts all
Cqlengine
andcassandra.cluster.Cluster
connection options - automatic connection/disconnection handling
- works well along with relational databases (as secondary DB)
- storing sessions in Cassandra
- working django forms
- usable admin panel with Cassandra models
Installation
Recommended installation:
pip install django-cassandra-engine
Basic Usage
-
Add
django_cassandra_engine
toINSTALLED_APPS
in yoursettings.py
file:INSTALLED_APPS = ('django_cassandra_engine',) + INSTALLED_APPS
-
Change
DATABASES
setting:DATABASES = { 'default': { 'ENGINE': 'django_cassandra_engine', 'NAME': 'db', 'TEST_NAME': 'test_db', 'HOST': 'db1.example.com,db2.example.com', 'OPTIONS': { 'replication': { 'strategy_class': 'SimpleStrategy', 'replication_factor': 1 } } } }
-
Define some model:
# myapp/models.py import uuid from cassandra.cqlengine import columns from django_cassandra_engine.models import DjangoCassandraModel class ExampleModel(DjangoCassandraModel): example_id = columns.UUID(primary_key=True, default=uuid.uuid4) example_type = columns.Integer(index=True) created_at = columns.DateTime() description = columns.Text(required=False)
-
Run
./manage.py sync_cassandra
-
Done!
Documentation
The documentation can be found online here.
Donation
If this project help you reduce time to develop, you can give me a cup of coffee :)
License
Copyright (c) 2014-2020, Rafał Furmański.
All rights reserved. Licensed under BSD 2-Clause 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
Built Distribution
Close
Hashes for django-cassandra-engine-1.6.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b747df3a5bcfb7fe9fba0c4d5335cd4a806f1f956112ea012737d1163c9eda4c |
|
MD5 | 8b7b30ad96909f8f767a4b3df23c927a |
|
BLAKE2b-256 | a0601d66b7f484798211fc85f3e86e4d97af65803d9f8ee24bbd03cc7966fd65 |
Close
Hashes for django_cassandra_engine-1.6.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a23125137617ff44609c9665be0ce21f8ae9d9b014c34479721a03209bdb2d7 |
|
MD5 | 51f03c41f008296dedfe64cbd0cf5af1 |
|
BLAKE2b-256 | c3d4c51b53aa74b24c3f18f19ddb789f1dfffdbe813a0396e3f2ad04d4642f3e |