Django Cassandra Engine - the Cassandra backend for Django
Project description
django-cassandra-engine is a database wrapper for Django Framework. It uses latest Cqlengine which is currently the best Cassandra CQL 3 Object Mapper for Python.
- License:
2-clause BSD
- Keywords:
django, cassandra, orm, nosql, database, python
- URL (pypi):
Installation
Recommended installation:
pip install django-cassandra-engine
Usage
Add django-cassandra-engine to INSTALLED_APPS in your settings.py file:
INSTALLED_APPS += ('django_cassandra_engine',)
IMPORTANT: This app should be last on INSTALLED_APPS list.
Also 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 cqlengine import columns from cqlengine.models import Model class ExampleModel(Model): read_repair_chance = 0.05 # optional - defaults to 0.1 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 syncdb
Done!
Documentation
You can find documentation here.
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
Close
Hashes for django-cassandra-engine-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6da682c3618e48ed1c5abe6f7be2f4ef60511c537dbe02dd4db18f30a500f4f |
|
MD5 | 2cf8219b0ec97391dc59b9cb91f3a520 |
|
BLAKE2b-256 | ed213c7b0e28c9c3b87873a9991e94071ab847c1ade8f0be93e144bd32daaa5e |