Discuss / Python / Django + wsgi 多数据库连接时报错,请求帮助

Django + wsgi 多数据库连接时报错,请求帮助

_海枫_

#1 Created at ... [Delete] [Delete and Lock User]

廖老师:
你好! 我在配置多数据库连接时遇到个问题,请您帮忙看看,谢谢! 我在settings.py中增加了oracle的配置,如下: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), }, 'apprdb': { 'ENGINE': 'django.db.backends.oracle', 'NAME': 'ORACLE10', #sid 'USER': 'apprdb', 'PASSWORD': 'apprdb', 'HOST': '10.130.0.53', 'PORT': '1521', }, }

apachectl start 启动服务后 登录网站报错如下: [wsgi:error] /usr/local/lib/python2.7/site-packages/setuptools-18.8.1-py2.7.egg/pkgresources/init.py:1266: UserWarning: /tmp/.python-eggs is writable by group/others and vulnerable to attack when used with getresourcefilename. Consider a more secure location (set with .setextractionpath or the PYTHONEGGCACHE environment variable). [wsgi:error] [wsgi:error] modwsgi (pid=12526): Exception occurred processing WSGI script '/home/lhf/lhfhttpd/DjangoProject/testproject/testproject/wsgi.py'. [wsgi:error] Traceback (most recent call last): [wsgi:error] File "/usr/local/lib/python2.7/site-packages/Django-1.9.1-py2.7.egg/django/core/handlers/wsgi.py", line 165, in call [wsgi:error] signals.requeststarted.send(sender=self._class, environ=environ) [wsgi:error] File "/usr/local/lib/python2.7/site-packages/Django-1.9.1-py2.7.egg/django/dispatch/dispatcher.py", line 192, in send [wsgi:error] response = receiver(signal=self, sender=sender, **named) [wsgi:error] File "/usr/local/lib/python2.7/site-packages/Django-1.9.1-py2.7.egg/django/db/__init.py", line 55, in reset_queries [wsgi:error] for conn in connections.all(): [wsgi:error] File "/usr/local/lib/python2.7/site-packages/Django-1.9.1-py2.7.egg/django/db/utils.py", line 227, in all [wsgi:error] return [self[alias] for alias in self] [wsgi:error] File "/usr/local/lib/python2.7/site-packages/Django-1.9.1-py2.7.egg/django/db/utils.py", line 212, in __getitem [wsgi:error] backend = load_backend(db['ENGINE']) [wsgi:error] File "/usr/local/lib/python2.7/site-packages/Django-1.9.1-py2.7.egg/django/db/utils.py", line 116, in load_backend [wsgi:error] return import_module('%s.base' % backend_name) [wsgi:error] File "/usr/local/lib/python2.7/importlib/__init.py", line 37, in import_module [wsgi:error] __import(name) [wsgi:error] File "/usr/local/lib/python2.7/site-packages/Django-1.9.1-py2.7.egg/django/db/backends/oracle/base.py", line 56, in <module> [wsgi:error] raise ImproperlyConfigured("Error loading cx_Oracle module: %s" % e) [wsgi:error] ImproperlyConfigured: Error loading cx_Oracle module: /tmp/.python-eggs/cx_Oracle-5.2.1-py2.7-linux-x86_64.egg-tmp/cx_Oracle.so: undefined symbol: OCICollGetElem

linux版本信息 Red Flag DC Server release 5.0 (Trinity SP4) Kernel 2.6.9-89.16.AXS2BIGPTYsmp on an x86_64 Apache版本 2.4.18 Python版本 2.7.11 Django版本 1.9.1 Mod_wsgi版本 4.4.22 cx_Oracle版本 5.2.1 oracle版本 10.2.0.1

使用python manage.py runserver 0.0.0.0:8000开发模式启动服务,可以正常访问网站


  • 1

Reply