0

I am trying to use RIAK database instead of sqlite3 for storage. I came across below git repository: https://github.com/oubiwann-unsupported/django-riak-engine.git

Followed the steps mentioned on github but i am getting the error. Got a post related to same but no answer to this problem,

django and riak engine not found

settings.py

import os
import django_riak_engine

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

SECRET_KEY = '0y-_enmi!j+idc3aat8l@6(f^h-_42b)oklhml+pwl72-x&f#q'

DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        'django.contrib.staticfiles',
        'django_riak_engine',
        'home',
        'fileupload',
]

MIDDLEWARE_CLASSES = [
        'django.middleware.security.SecurityMiddleware',
        'django.contrib.sessions.middleware.SessionMiddleware',
        'django.middleware.common.CommonMiddleware',
        'django.middleware.csrf.CsrfViewMiddleware',
        'django.contrib.auth.middleware.AuthenticationMiddleware',
        'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
        'django.contrib.messages.middleware.MessageMiddleware',
        'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'DQCheckWebApplication.urls'

TEMPLATES = [
        {
                'BACKEND': 'django.template.backends.django.DjangoTemplates',
                'DIRS': [os.path.join(BASE_DIR, "templates")],
                'APP_DIRS': True,
                'OPTIONS': {
                        'context_processors': [
                                'django.template.context_processors.debug',
                                'django.template.context_processors.request',
                                'django.contrib.auth.context_processors.auth',
                                'django.contrib.messages.context_processors.messages',
                        ],
                },
        },
]

WSGI_APPLICATION = 'DQCheckWebApplication.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases

DATABASES = {
        'default': {
                'ENGINE': 'django_riak_engine',
                'NAME': 'dqcheck',
                'USER': '',
                'PASSWORD': '',
                'HOST': '192.168.51.107',
                'PORT': '8098',
                'SUPPORTS_TRANSACTIONS': False,
        }
}


# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
        {
                'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
        },
        {
                'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
        },
        {
                'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
        },
        {
                'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
        },
]


# Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

STATIC_URL = '/static/'

STATIC_ROOT = os.path.join(BASE_DIR, "static", "static_root")

STATICFILES_DIRS = [
        os.path.join(BASE_DIR, "static", "my_static"),
        # '/var/www/static/',
]

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, "static", "media_root")

LOGGING = {
        'version': 1,
        'disable_existing_loggers': False,
        'formatters': {
                'verbose': {
                        'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
                        'datefmt' : "%d/%b/%Y %H:%M:%S"
                },
                'simple': {
                        'format': '%(levelname)s %(message)s'
                },
        },
        'handlers': {
                'django-file': {
                        'level': 'DEBUG',
                        'class': 'logging.FileHandler',
                        'filename': '/var/log/dqcheck/web-application-django-core.log',
                        'formatter': 'verbose'
                },
                'app-file': {
                        'level': 'DEBUG',
                        'class': 'logging.FileHandler',
                        'filename': '/var/log/dqcheck/web-application.log',
                        'formatter': 'verbose'
                },
        },
        'loggers': {
                'django': {
                        'handlers':['django-file'],
                        'propagate': True,
                        'level':'DEBUG',
                },
                'dq-check': {
                        'handlers': ['app-file'],
                        'level': 'DEBUG',
                },
        }
}

Error:

python manage.py migrate
Traceback (most recent call last):
    File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
    File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 353, in execute_from_command_line
    utility.execute()
    File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 327, in execute
    django.setup()
    File "C:\Python27\lib\site-packages\django\__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
    File "C:\Python27\lib\site-packages\django\apps\registry.py", line 108, in populate
    app_config.import_models(all_models)
    File "C:\Python27\lib\site-packages\django\apps\config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
    File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
    File "C:\Python27\lib\site-packages\django\contrib\auth\models.py", line 4, in <module>
    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
    File "C:\Python27\lib\site-packages\django\contrib\auth\base_user.py", line 49, in <module>
    class AbstractBaseUser(models.Model):
    File "C:\Python27\lib\site-packages\django\db\models\base.py", line 108, in __new__
    new_class.add_to_class('_meta', Options(meta, app_label))
    File "C:\Python27\lib\site-packages\django\db\models\base.py", line 299, in add_to_class
    value.contribute_to_class(cls, name)
    File "C:\Python27\lib\site-packages\django\db\models\options.py", line 263, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
    File "C:\Python27\lib\site-packages\django\db\__init__.py", line 36, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
    File "C:\Python27\lib\site-packages\django\db\utils.py", line 212, in __getitem__
    backend = load_backend(db['ENGINE'])
    File "C:\Python27\lib\site-packages\django\db\utils.py", line 135, in load_backend
    raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: 'django_riak_engine.riak' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
    'mysql', 'oracle', 'postgresql', 'sqlite3'
Error was: No module named riak.base
Community
  • 1
  • 1
kk.
  • 3,747
  • 12
  • 36
  • 67
  • I think you have found a dead project. The readme at the link you provided states, `Please note: this is a development README! None of this works yet. When we're done, this is what you will read to learn about and use this product`, and there has not been a commit in over 4 years. – Joe Feb 26 '16 at 17:00
  • Thanks joe for pointing this out. Do you have any idea about connecting to RIAK database using django project? – kk. Mar 01 '16 at 12:03

0 Answers0