没有找到django和riak引擎 [英] django and riak engine not found

查看:167
本文介绍了没有找到django和riak引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有django riak引擎有这个错误:



django.core.exceptions.ImproperlyConfigured:'django_riak_engine.riak'不是
可用数据库后端。
尝试使用django.db.backends.XXX,其中XXX是以下之一:



我已经安装了所需的所有依赖项。



这是我的settings.py:

 #林项目的Django设置。 

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS =(
#('Your Name','your_email@example.com'),


MANAGERS = ADMINS

DATABASES = {
'default':{
'ENGINE':'django_riak_engine.riak',
'NAME':'mydatabase',
'USER':'',
'PASSWORD':'',
'HOST':'localhost',
' PORT':'8091',
'SUPPORTS_TRANSACTIONS':False,
},
}

#此安装的本地时区。可以在这里找到选择:
#http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
#虽然并不是所有的操作系​​统都可以选择所有选项。
#在Unix系统上,值为None将导致Django与操作系统使用相同的
#timezone。
#如果在Windows环境中运行,必须设置为与
#系统时区相同。
TIME_ZONE ='美国/芝加哥'

#此安装的语言代码。所有选择都可以在这里找到:
#http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE ='en-us'

SITE_ID = 1

#如果将其设置为False,Django将进行一些优化,以便
#加载国际化机器。
USE_I18N = True

#如果将其设置为False,Django将不会根据当前的区域设置格式化日期,数字和
#日历
USE_L10N = True

#将保存用户上传文件的目录的绝对文件系统路径。
#示例:/home/media/media.lawrence.com/media/
MEDIA_ROOT =''

#处理从MEDIA_ROOT提供的媒体的URL。确保使用
#尾部斜线。
#示例:http://media.lawrence.com/media/,http://example.com/media/
MEDIA_URL =''

#静态文件的绝对路径应该被收集到。
#不要把任何东西放在这个目录下;在应用程序的static /子目录和STATICFILES_DIRS中存储静态文件
#。
#示例:/home/media/media.lawrence.com/static/
STATIC_ROOT =''

#静态文件的URL前缀。
#示例:http://media.lawrence.com/static/
STATIC_URL ='/ static /'

#admin静态文件的URL前缀 - CSS ,JavaScript和图像。
#确保使用尾部斜线。
#示例:http://foo.com/static/admin/,/ static / admin /。
ADMIN_MEDIA_PREFIX ='/ static / admin /'

#静态文件的附加位置
STATICFILES_DIRS =(
#将字符串放在这里,如/ home / html /静态或C:/ www / django / static
#即使在Windows上也可以使用正斜杠
#不要忘记使用绝对路径,而不是相对路径


#知道如何在
#各个位置找到静态文件的finder类的列表。
STATICFILES_FINDERS =(
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#'django.contrib.staticfiles .finders.DefaultStorageFinder',


#使其独一无二,不要与任何人共享。
SECRET_KEY =''

#知道如何从各种来源导入模板的可调用列表。
TEMPLATE_LOADERS =(
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
#'django.template.loaders .eggs.Loader',


MIDDLEWARE_CLASSES =(
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware ',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',


ROOT_URLCONF ='Lin.urls'

TEMPLATE_DIRS =(
#将字符串放在这里,如/ home / html / django_templates或C :/ www / django / templates
#总是使用正斜杠,甚至在Windows上
#不要忘记使用绝对路径,而不是相对路径


INSTALLED_APPS =(
'django.contrib.auth',
'django.contrib.contenttypes',
'django。 contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
#取消注释下一行启用admin:
'django.contrib.admin',
#取消注释下一行以启用管理员文档:
'django.contrib.admindocs',
'contacts' ,


#样本记录配置。通过此配置执行的唯一有形日志
#是发送电子邮件到
#每个HTTP 500错误的站点管理员。
#有关如何自定义日志配置的详细信息,请参阅http://docs.djangoproject.com/en/dev/topics/logging for
#。
LOGGING = {
'version':1,
'disable_existing_loggers':False,
'handlers':{
'mail_admins':{
'级别':'ERROR',
'class':'django.utils.log.AdminEmailHandler'
}
},
'loggers':{
'django .request':{
'handlers':['mail_admins'],
'level':'ERROR',
'propagate':True,
},$ b $你有什么想法吗?




$ b



< b $ b

认为



Bussiere

解决方案

安装所有依赖项?从标准的Python shell尝试

  from django_riak_engine import riak 

,看看你是否收到错误。


i have this error with django riak engine :

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:

I've installed all the dependencies needed.

Here is my settings.py :

# Django settings for Lin project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', 'your_email@example.com'),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django_riak_engine.riak',
        'NAME': 'mydatabase',
        'USER': '',
        'PASSWORD': '',
        'HOST': 'localhost',
        'PORT': '8091',
        'SUPPORTS_TRANSACTIONS': False,
    },
}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = ''

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'

# URL prefix for admin static files -- CSS, JavaScript and images.
# Make sure to use a trailing slash.
# Examples: "http://foo.com/static/admin/", "/static/admin/".
ADMIN_MEDIA_PREFIX = '/static/admin/'

# Additional locations of static files
STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# Make this unique, and don't share it with anybody.
SECRET_KEY = ''

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
#     'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = 'Lin.urls'

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
    'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    'django.contrib.admindocs',
    'contacts',
)

# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'class': 'django.utils.log.AdminEmailHandler'
        }
    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
    }
}

Have you any idea ?

regards

Bussiere

解决方案

Did you install all dependencies? From a standard Python shell try

from django_riak_engine import riak

and see if you get errors.

这篇关于没有找到django和riak引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆