我正在尝试将django与SAP Hana DB连接起来。我已经安装了github中描述的后端:https://github.com/kapilratnani/django_hana 和 按指定配置settings.py:
'data_source': {
'ENGINE':'django.db.backends.django_hana',# I tried also 'django_hana' or 'hello' with the same results
'NAME': 'IOT',
'USER': 'ALEX',
'PASSWORD': 'PASSWORD',
'HOST': '186.47.255.17',
'PORT': '30015',
}
我收到连接错误,好像它没有识别引擎:如果我在引擎中输入'hello',我会得到同样的错误。这是错误:
Unhandled exception in thread started by <function wrapper at 0x7fc2a959f0c8>
Traceback (most recent call last):
File "/home/django/Env/singolar/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/home/django/Env/singolar/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 116, in inner_run
self.check(display_num_errors=True)
File "/home/django/Env/singolar/lib/python2.7/site-packages/django/core/management/base.py", line 426, in check
include_deployment_checks=include_deployment_checks,
File "/home/django/Env/singolar/lib/python2.7/site-packages/django/core/checks/registry.py", line 75, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/django/Env/singolar/lib/python2.7/site-packages/django/core/checks/model_checks.py", line 28, in check_all_models
errors.extend(model.check(**kwargs))
File "/home/django/Env/singolar/lib/python2.7/site-packages/django/db/models/base.py", line 1172, in check
errors.extend(cls._check_long_column_names())
File "/home/django/Env/singolar/lib/python2.7/site-packages/django/db/models/base.py", line 1587, in _check_long_column_names
connection = connections[db]
File "/home/django/Env/singolar/lib/python2.7/site-packages/django/db/utils.py", line 212, in __getitem__
backend = load_backend(db['ENGINE'])
File "/home/django/Env/singolar/lib/python2.7/site-packages/django/db/utils.py", line 135, in load_backend
raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: 'django.db.backends.django_hana' 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 django_hana.base
为什么它不能识别引擎?
答案 0 :(得分:0)
找到支持Django 1.9的存储库并解决错误:github.com/mathebox/django_hana_pyhdb