Skip to main content

Django Cassandra Engine - the Cassandra backend for Django

Project description

Latest Version Downloads

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.


2-clause BSD


django, cassandra, orm, nosql, database, python

URL (pypi):



  • cassandra

  • cqlengine

  • django-nonrel

  • djangotoolbox

  • django (1.6 or 1.7)


  • complete Django integration

  • working syncdb and flush commands

  • support for creating/destroying test database

  • accept all Cqlengine connection options

  • automatic connection/disconnection handling

  • support for multiple databases (also relational)


Recommended installation:

pip install django-cassandra-engine


  1. Add django-cassandra-engine to INSTALLED_APPS in your file:

    INSTALLED_APPS += ('django_cassandra_engine',)

IMPORTANT: This app should be last on INSTALLED_APPS list.

  1. Also change DATABASES setting:

        'default': {
            'ENGINE': 'django_cassandra_engine',
            'NAME': 'db',
            'TEST_NAME': 'test_db',
            'HOST': ',',
            'OPTIONS': {
                'replication': {
                    'strategy_class': 'SimpleStrategy',
                    'replication_factor': 1
  2. Define some model:

    #  myapp/
    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)
  3. Run ./ syncdb

  4. Done!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-cassandra-engine-0.0.6.tar.gz (6.6 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page