When using django-cassandra-engine sessions I get an error in INSTALLED_APPS


I'm using django-cassandra-engine for session storage, when I start the server I get this error:

RuntimeError: Model class django.contrib.sessions.models.Session doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS

The steps I followed are these link

INSTALLED_APPS += ['django_cassandra_engine.sessions']

SESSION_BACKEND = 'django_cassandra_engine.sessions.backends.db'

My settings file:

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
WORK_DIR = os.getcwd()

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '*******'

# Application definition


SESSION_BACKEND = 'django_cassandra_engine.sessions.backends.db'


ROOT_URLCONF = '.....urls'

        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(WORK_DIR, "templates"),],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [

WSGI_APPLICATION = '.....wsgi.application'

TIME_ZONE = 'America/Guayaquil'
USE_I18N = True
USE_L10N = True
USE_TZ = True

MEDIA_ROOT = os.path.join(WORK_DIR, 'media')
MEDIA_URL = '/media/'
    os.path.join(WORK_DIR, "static"),
STATIC_URL = '/static/'
asked by EdgarAlejandro 02.08.2017 в 00:35

1 answer


I think the error is the name of the Django setting to specify the backend to be used.

Instead of using SESSION_BACKEND try to change to SESSION_ENGINE :

SESSION_ENGINE = 'django_cassandra_engine.sessions.backends.db'

The django-cassandra-engine documentation must be outdated. That's why you get that error because, by default, the value of SESSION_ENGINE is:

SESSION_ENGINE = 'django.contrib.sessions.backends.db'

But as you said, I could not find it. With this change it should work.

answered by 02.08.2017 / 01:42