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-driverand optionallydse-driverfrom DataStax - working
flush,migrate,sync_cassandra,inspectdbanddbshellcommands - support for creating/destroying test database
- accepts all
Cqlengineandcassandra.cluster.Clusterconnection 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_enginetoINSTALLED_APPSin yoursettings.pyfile:INSTALLED_APPS = ('django_cassandra_engine',) + INSTALLED_APPS -
Change
DATABASESsetting: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.
License
Copyright (c) 2014-2021, 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
File details
Details for the file django-cassandra-engine-1.6.2.tar.gz.
File metadata
- Download URL: django-cassandra-engine-1.6.2.tar.gz
- Upload date:
- Size: 29.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4600dae649b1aebe4d1f0e84b193b92a2cf849e0c5bc0f25bfbee6220a02be27
|
|
| MD5 |
0c1a5d1e8b987dd87a31efc957c66770
|
|
| BLAKE2b-256 |
1f5e438eb7f2d8b8e240701b721a43cb5a20cf970c8e9da8b3770df1de6d7c5b
|