感谢您查看这个。我对 Django 和 LDAP Config 很陌生......所以非常感谢任何帮助!
ActivePython 2.6、Django-1.2.7、openldap-2.4.23、python-ldap
所以我安装了 Django。我正在尝试按照此说明http://djangosnippets.org/snippets/901/为其配置 LDAP 。
在按照上述文档中所述进行更改后,当我运行“python manage.py runserver”时,我遇到了这个错误。知道为什么会这样吗?一直在看这个大约一个星期,不知道如何解决这个问题。
Error:
ValueError at /admin/
option error
Request Method: POST
Request URL: http://0.0.0.0:8080/admin/
Django Version: 1.2.7
Exception Type: ValueError
Exception Value:
option error
Exception Location: /apps/essw/python/lib/python2.6/site-packages/python_ldap-2.4.10-py2.6-linux-x86_64.egg/ldap/functions.py in _ldap_function_call, line 63
Python Executable: /apps/essw/python/bin/python
Python Version: 2.6.7
Python Path: ['/apps/essw/mysite', '/apps/essw/python/lib/python2.6/site-packages/python_ldap-2.4.10-py2.6-linux-x86_64.egg', '/apps/essw/python/lib/python2.6/site-packages/elementtree-1.2.7_20070827_preview-py2.6.egg', '/apps/essw/python/lib/python2.6/site-packages/Markdown-2.2.0-py2.6.egg', '/apps/essw/python/lib/python2.6/site-packages/html5lib-0.95-py2.6.egg', '/apps/essw/python/lib/python26.zip', '/apps/essw/python/lib/python2.6', '/apps/essw/python/lib/python2.6/plat-linux2', '/apps/essw/python/lib/python2.6/lib-tk', '/apps/essw/python/lib/python2.6/lib-old', '/apps/essw/python/lib/python2.6/lib-dynload', '/apps/essw/python/lib/python2.6/site-packages', '/apps/essw/python/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info']
Server time: Wed, 25 Jul 2012 09:06:41 -0500
@ChrisPratt 感谢克里斯的回复!看看这是否有帮助
Environment:
Request Method: POST
Request URL: http://x.x.x.x:8080/admin/
Django Version: 1.2.7
Python Version: 2.6.7
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.admindocs']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/apps/essw/python/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response
100. response = callback(request, *callback_args, **callback_kwargs)
File "/apps/essw/python/lib/python2.6/site-packages/django/contrib/admin/sites.py" in wrapper
208. return self.admin_view(view, cacheable)(*args, **kwargs)
File "/apps/essw/python/lib/python2.6/site-packages/django/utils/decorators.py" in _wrapped_view
76. response = view_func(request, *args, **kwargs)
File "/apps/essw/python/lib/python2.6/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
78. response = view_func(request, *args, **kwargs)
File "/apps/essw/python/lib/python2.6/site-packages/django/contrib/admin/sites.py" in inner
190. return self.login(request)
File "/apps/essw/python/lib/python2.6/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
78. response = view_func(request, *args, **kwargs)
File "/apps/essw/python/lib/python2.6/site-packages/django/contrib/admin/sites.py" in login
323. user = authenticate(username=username, password=password)
File "/apps/essw/python/lib/python2.6/site-packages/django/contrib/auth/__init__.py" in authenticate
52. user = backend.authenticate(**credentials)
File "/apps/essw/mysite/django_auth_ldap/backend.py" in authenticate
824. ldap.set_option(ldap.OPT_X_TLS_CACERTFILE,settings.AD_CERT_FILE)
File "/apps/essw/python/lib/python2.6/site-packages/python_ldap-2.4.10-py2.6-linux- x86_64.egg/ldap/functions.py" in set_option
132. return _ldap_function_call(None,_ldap.set_option,option,invalue)
File "/apps/essw/python/lib/python2.6/site-packages/python_ldap-2.4.10-py2.6-linux- x86_64.egg/ldap/functions.py" in _ldap_function_call
63. result = func(*args,**kwargs)
Exception Type: ValueError at /admin/
Exception Value: option error