我使用OSQA部署了一个问答网站。我对 OpenID 有疑问。当我点击提供商注册新用户(即 google)时,osqa 将我重定向到 google 以确认我的电子邮件地址。然后我回到osqa,它要求输入用户名和密码。在下一步中,我收到 500 服务器错误并且注册失败。我可以使用正常的注册表单注册新用户并登录没有任何问题。
这是 /log/django.osqa.log 的最后几行:
/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/core/handlers/base.py TIME: 2013-06-01 00:40:52,772 MSG: base.py:handle_uncaught_exception:209 Internal Server Error: /account/register/
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/osqa/osqa-server/forum/views/auth.py", line 159, in external_register
if form1.is_valid():
File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/forms/forms.py", line 121, in is_valid
return self.is_bound and not bool(self.errors)
File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/forms/forms.py", line 112, in _get_errors
self.full_clean()
File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/forms/forms.py", line 267, in full_clean
self._clean_fields()
File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/forms/forms.py", line 284, in _clean_fields
value = field.clean(value)
File "/home/osqa/osqa-server/forum/forms/general.py", line 151, in clean
return super(UserRealNameField, self).clean(real_name)
File "/home/osqa/osqa-server/forum/forms/general.py", line 27, in clean
value = value.strip()
AttributeError: 'NoneType' object has no attribute 'strip'
/home/osqa/osqa-server/forum/views/meta.py TIME: 2013-06-01 00:40:52,777 MSG: meta.py:error_handler:200
error executing request:
PATH: /account/register/
USER: <anonymous>
METHOD: POST
POST PARAMETERS:
username: asbol
csrfmiddlewaretoken: 3204ab843f346dd595302ae4910ea26d
email: asbolasbol@gmail.com
bnewaccount: Create Account
next: /
GET PARAMETERS:
None
HTTP HEADERS:
mod_wsgi.listener_port: 80
HTTP_REFERER: http://domain/account/register/
mod_wsgi.listener_host:
SERVER_SOFTWARE: Apache/2.2.22 (Ubuntu)
SCRIPT_NAME:
mod_wsgi.handler_script:
SERVER_SIGNATURE: <address>Apache/2.2.22 (Ubuntu) Server at domain Port 80</address>
REQUEST_METHOD: POST
PATH_INFO: /account/register/
HTTP_ORIGIN: http://domain
SERVER_PROTOCOL: HTTP/1.1
QUERY_STRING:
CONTENT_LENGTH: 221
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36
HTTP_CONNECTION: keep-alive
HTTP_COOKIE: __atuvc=1%7C22; greeting_set=True; csrftoken=3204ab843f346dd595302ae4910ea26d; sessionid=c59f00fd45976880b724074376627286
SERVER_NAME: domain
REMOTE_ADDR: 5.63.149.98
mod_wsgi.request_handler: wsgi-script
wsgi.url_scheme: http
PATH_TRANSLATED: /home/osqa/osqa-server/osqa.wsgi/account/register/
SERVER_PORT: 80
wsgi.multiprocess: False
mod_wsgi.input_chunked: 0
SERVER_ADDR: IP
DOCUMENT_ROOT: /home/osqa/osqa-server
mod_wsgi.process_group: OSQA
SCRIPT_FILENAME: /home/osqa/osqa-server/osqa.wsgi
SERVER_ADMIN: admin@domain
wsgi.input: <mod_wsgi.Input object at 0x7f40b05e6870>
HTTP_HOST: domain
wsgi.multithread: True
mod_wsgi.callable_object: application
HTTP_CACHE_CONTROL: max-age=0
REQUEST_URI: /account/register/
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
wsgi.version: (1, 1)
GATEWAY_INTERFACE: CGI/1.1
wsgi.run_once: False
wsgi.errors: <mod_wsgi.Log object at 0x7f40b9e83a30>
REMOTE_PORT: 55121
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
mod_wsgi.version: (3, 3)
CONTENT_TYPE: application/x-www-form-urlencoded
mod_wsgi.application_group: domain|
mod_wsgi.script_reloading: 1
wsgi.file_wrapper: <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f40b065aaf8>
CSRF_COOKIE: 3204ab843f346dd595302ae4910ea26d
HTTP_ACCEPT_ENCODING: gzip,deflate,sdch
COOKIES:
__atuvc: 1%7C22
csrftoken: 3204ab843f346dd595302ae4910ea26d
sessionid: c59f00fd45976880b724074376627286
greeting_set: True
EXCEPTION INFO:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/osqa/osqa-server/forum/views/auth.py", line 159, in external_register
if form1.is_valid():
File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/forms/forms.py", line 121, in is_valid
return self.is_bound and not bool(self.errors)
File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/forms/forms.py", line 112, in _get_errors
self.full_clean()
File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/forms/forms.py", line 267, in full_clean
self._clean_fields()
File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/forms/forms.py", line 284, in _clean_fields
value = field.clean(value)
File "/home/osqa/osqa-server/forum/forms/general.py", line 151, in clean
return super(UserRealNameField, self).clean(real_name)
File "/home/osqa/osqa-server/forum/forms/general.py", line 27, in clean
value = value.strip()
AttributeError: 'NoneType' object has no attribute 'strip'
我该如何解决这个问题?