我已经按照这个示例设置了Django LDAP 身份验证。而且似乎后端确实有效,即我已经确认
- LDAP 访问通过python-ldap完美运行
- 调试显示用户实际上可以进行身份验证
- 创建用户和用户配置文件对象(并毫无问题地存储到数据库)
但是,当成功登录后的结果页面被呈现时,我得到一个PicklingError: Can't pickle <type 'module'>: attribute lookup __builtin__.module failed
使用model
身份验证后端时不存在此类问题。此外,失败调用中的变量看起来都还不错。这是回溯:
Traceback:
File "<anonymized>/lib/Django-1.4.1-py2.6.egg/django/core/handlers/base.py" in get_response
188. response = middleware_method(request, response)
File "<anonymized>/lib/Django-1.4.1-py2.6.egg/django/contrib/sessions/middleware.py" in process_response
36. request.session.save()
File "<anonymized>/lib/Django-1.4.1-py2.6.egg/django/contrib/sessions/backends/db.py" in save
52. session_data=self.encode(self._get_session(no_load=must_create)),
File "<anonymized>/lib/Django-1.4.1-py2.6.egg/django/contrib/sessions/backends/base.py" in encode
79. pickled = pickle.dumps(session_dict, pickle.HIGHEST_PROTOCOL)
Exception Type: PicklingError at /
Exception Value: Can't pickle <type 'module'>: attribute lookup __builtin__.module failed
会话字典与来自后端的用户非常相似,model
但项目除外'_auth_user_backend': 'django_auth_ldap.backend.LDAPBackend',